Merge commit 'cc8db760616a7ec3bd39b22ca45888c01326db13'
authorHendrik Leppkes <h.leppkes@gmail.com>
Tue, 29 Sep 2015 11:45:23 +0000 (13:45 +0200)
committerHendrik Leppkes <h.leppkes@gmail.com>
Tue, 29 Sep 2015 11:45:23 +0000 (13:45 +0200)
* commit 'cc8db760616a7ec3bd39b22ca45888c01326db13':
  mpegts: use avcodec_get_type() to set codec_type

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
libavformat/mpegts.c

index 44d176e..9982f10 100644 (file)
@@ -1543,14 +1543,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++)