Commit 271a0004 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavf/rawdec: Do not mark streams from raw subtitle demuxers as data streams.

Improves "ffmpeg -i" output for raw dvbsub files.
parent 68f289da
...@@ -91,6 +91,17 @@ fail: ...@@ -91,6 +91,17 @@ fail:
return ret; return ret;
} }
int ff_raw_subtitle_read_header(AVFormatContext *s)
{
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codecpar->codec_id = s->iformat->raw_codec_id;
st->start_time = 0;
return 0;
}
int ff_raw_data_read_header(AVFormatContext *s) int ff_raw_data_read_header(AVFormatContext *s)
{ {
AVStream *st = avformat_new_stream(s, NULL); AVStream *st = avformat_new_stream(s, NULL);
......
...@@ -41,6 +41,8 @@ int ff_raw_audio_read_header(AVFormatContext *s); ...@@ -41,6 +41,8 @@ int ff_raw_audio_read_header(AVFormatContext *s);
int ff_raw_video_read_header(AVFormatContext *s); int ff_raw_video_read_header(AVFormatContext *s);
int ff_raw_subtitle_read_header(AVFormatContext *s);
int ff_raw_data_read_header(AVFormatContext *s); int ff_raw_data_read_header(AVFormatContext *s);
#define FF_RAWVIDEO_DEMUXER_CLASS(name)\ #define FF_RAWVIDEO_DEMUXER_CLASS(name)\
...@@ -83,7 +85,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\ ...@@ -83,7 +85,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\
.name = #shortname,\ .name = #shortname,\
.long_name = NULL_IF_CONFIG_SMALL(longname),\ .long_name = NULL_IF_CONFIG_SMALL(longname),\
.read_probe = probe,\ .read_probe = probe,\
.read_header = ff_raw_data_read_header,\ .read_header = ff_raw_subtitle_read_header,\
.read_packet = ff_raw_read_partial_packet,\ .read_packet = ff_raw_read_partial_packet,\
.extensions = ext,\ .extensions = ext,\
.flags = flag,\ .flags = flag,\
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
// Also please add any ticket numbers that you believe might be affected here // Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58 #define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 23 #define LIBAVFORMAT_VERSION_MINOR 23
#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment