summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-13 20:37:04 +0200
committerMartin Storsjö <martin@martin.st>2013-07-29 09:50:05 +0300
commitcdd2d73d315ecaf19ff49e64c91923275f1bda68 (patch)
tree67394892f4215f2b78ea316afe9d3d22c07ba63a
parent82bf8c878345b6178ba32c7270a86670a92a72c2 (diff)
hls: Don't check discard flags until the parent demuxer's streams actually exist
If passing the end of one segment while initializing the chained demuxer, the parent demuxer's streams aren't set up yet, so we can't recheck the discard flags. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/hls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index b9b1feaf3d..213b71764b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -427,7 +427,8 @@ reload:
c->end_of_segment = 1;
c->cur_seq_no = v->cur_seq_no;
- if (v->ctx && v->ctx->nb_streams) {
+ if (v->ctx && v->ctx->nb_streams &&
+ v->parent->nb_streams >= v->stream_offset + v->ctx->nb_streams) {
v->needed = 0;
for (i = v->stream_offset; i < v->stream_offset + v->ctx->nb_streams;
i++) {