Ffmpeg/ffprobe/ffplay sets scan_all_pmts to 1 when finding the streams, that should be enough to handle files for which some early PMTs miss some streams. Fixes ticket #9782.
Unified · Split
| @@ -2870,16 +2870,8 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet, int64_t pos) · 2869 unmodified lines | |||
| 2870 | break; | 2870 | break; |
| 2871 | } | 2871 | } |
| 2872 | if (i == ts->nb_prg && ts->nb_prg > 0) { | 2872 | if (i == ts->nb_prg && ts->nb_prg > 0) { |
| 2873 | int types = 0; | 2873 | av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n"); |
| 2874 | for (i = 0; i < ts->stream->nb_streams; i++) { | 2874 | ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER; |
| 2875 | AVStream *st = ts->stream->streams[i]; | ||
| 2876 | if (st->codecpar->codec_type >= 0) | ||
| 2877 | types |= 1<<st->codecpar->codec_type; | ||
| 2878 | } | ||
| 2879 | if ((types & (1<<AVMEDIA_TYPE_AUDIO) && types & (1<<AVMEDIA_TYPE_VIDEO)) || pos > 100000) { | ||
| 2880 | av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n"); | ||
| 2881 | ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER; | ||
| 2882 | } | ||
| 2883 | } | 2875 | } |
| 2884 | } | 2876 | } |
| 2885 | 2877 | ||