diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-09-26 18:42:51 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-09-28 10:50:50 +0200 |
commit | cc8db760616a7ec3bd39b22ca45888c01326db13 (patch) | |
tree | 1b7ffafdc1e8340929a46aecb18cf23d5376cd52 /libavformat/mpegts.c | |
parent | a5d58fea68b9212e0065a71939e921505504a9bb (diff) | |
download | ffmpeg-cc8db760616a7ec3bd39b22ca45888c01326db13.tar.gz |
mpegts: use avcodec_get_type() to set codec_type
Note that this slightly changes behavior: it sets AVMEDIA_TYPE_UNKNOWN
if the codec type is unknown. This should be ok.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r-- | libavformat/mpegts.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 3a27343cf0..e9e3288820 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1311,14 +1311,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, st->codec->extradata_size > 0) st->need_parsing = 0; - if (st->codec->codec_id <= AV_CODEC_ID_NONE) { - // do nothing - } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_AUDIO) - st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - else if (st->codec->codec_id < AV_CODEC_ID_FIRST_SUBTITLE) - st->codec->codec_type = AVMEDIA_TYPE_AUDIO; - else if (st->codec->codec_id < AV_CODEC_ID_FIRST_UNKNOWN) - st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; + st->codec->codec_type = avcodec_get_type(st->codec->codec_id); } } for (i = 0; i < mp4_descr_count; i++) |