]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpegts.c
electronicarts: move video stream properties into dedicated structure
[ffmpeg] / libavformat / mpegts.c
index aeb2335eac8b316ecec7353f5d2cc03a4002bc85..37043a69f4d6712eb9d921b21b48d670392af688 100644 (file)
@@ -835,6 +835,14 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
         st->codec->codec_id  = old_codec_id;
         st->codec->codec_type = old_codec_type;
     }
+    if ((st->codec->codec_id == AV_CODEC_ID_NONE ||
+            (st->request_probe > 0 && st->request_probe < AVPROBE_SCORE_STREAM_RETRY / 5)) &&
+        !avcodec_is_open(st->codec) &&
+        stream_type == STREAM_TYPE_PRIVATE_DATA) {
+        st->codec->codec_type = AVMEDIA_TYPE_DATA;
+        st->codec->codec_id   = AV_CODEC_ID_BIN_DATA;
+        st->request_probe = AVPROBE_SCORE_STREAM_RETRY / 5;
+    }
 
     return 0;
 }
@@ -1758,7 +1766,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
     case 0x05: /* registration descriptor */
         st->codec->codec_tag = bytestream_get_le32(pp);
         av_log(fc, AV_LOG_TRACE, "reg_desc=%.4s\n", (char *)&st->codec->codec_tag);
-        if (st->codec->codec_id == AV_CODEC_ID_NONE)
+        if (st->codec->codec_id == AV_CODEC_ID_NONE || st->request_probe > 0)
             mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
         break;
     case 0x52: /* stream identifier descriptor */