summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-11-27 18:22:02 +0100
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-11-28 22:51:37 +0100
commit271a00043ef3116d9561e45fa5773a0d9a0993c2 (patch)
tree0ee08413d6b3aa5eb114a8bef0f4d74915aa45a6 /libavformat
parent68f289dacddcdf9742a8e9af51956ac226bfbafb (diff)
downloadffmpeg-streaming-271a00043ef3116d9561e45fa5773a0d9a0993c2.zip
ffmpeg-streaming-271a00043ef3116d9561e45fa5773a0d9a0993c2.tar.gz
lavf/rawdec: Do not mark streams from raw subtitle demuxers as data streams.
Improves "ffmpeg -i" output for raw dvbsub files.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rawdec.c11
-rw-r--r--libavformat/rawdec.h4
-rw-r--r--libavformat/version.h2
3 files changed, 15 insertions, 2 deletions
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index b38a4b5..6249352 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -91,6 +91,17 @@ fail:
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)
{
AVStream *st = avformat_new_stream(s, NULL);
diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h
index a464bbb..3eb416b 100644
--- a/libavformat/rawdec.h
+++ b/libavformat/rawdec.h
@@ -41,6 +41,8 @@ int ff_raw_audio_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);
#define FF_RAWVIDEO_DEMUXER_CLASS(name)\
@@ -83,7 +85,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\
.name = #shortname,\
.long_name = NULL_IF_CONFIG_SMALL(longname),\
.read_probe = probe,\
- .read_header = ff_raw_data_read_header,\
+ .read_header = ff_raw_subtitle_read_header,\
.read_packet = ff_raw_read_partial_packet,\
.extensions = ext,\
.flags = flag,\
diff --git a/libavformat/version.h b/libavformat/version.h
index 70e868f..824b9e7 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#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, \
LIBAVFORMAT_VERSION_MINOR, \
OpenPOWER on IntegriCloud