Skip to content
Permalink
Browse files

avformat/hls: Fix missing streams in some cases with MPEG TS

Do not disable AVFMTCTX_NOHEADER for subdemuxers as that prevents some
streams from being found in case of some MPEG TS streams.

The short-circuit path added to mpegts in 6eda91a ("mpegts:
stop analyzing when pmt for all programs have been found") should allow
the avformat_find_stream_info() call to now proceed quickly in many
cases, and in the remaining cases the segment size is often larger than
the maximum analyze duration, so the adverse effects should be minimal.

Fixes ticket #4930.

Note: If backporting it is recommended to also apply be52a0d
("avformat/utils: Fix find_stream_info not considering the extradata it
found") to avoid needlessly long avformat_find_stream_info() calls the
bug it fixed caused. That bug would be triggered in more cases after
applying this commit without that fix.
  • Loading branch information...
anssih committed Jul 26, 2016
1 parent be52a0d commit 2fd2c0bf7478ec481792eab7f42085af0f9e109d
Showing with 0 additions and 1 deletion.
  1. +0 −1 libavformat/hls.c
@@ -1641,7 +1641,6 @@ static int hls_read_header(AVFormatContext *s)
pls->id3_deferred_extra = NULL;
}

pls->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
ret = avformat_find_stream_info(pls->ctx, NULL);
if (ret < 0)
goto fail;

0 comments on commit 2fd2c0b

Please sign in to comment.
You can’t perform that action at this time.