summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-07-04 23:34:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-17 00:12:04 +0200
commit12d82004c51f46464a032e9081879945cf495a25 (patch)
tree442f7b4b1e2959ca0bef0d83888f07d7b19d4aa7
parent7ff0137a1f3bd6b12ca0c55303085ef3128ded98 (diff)
downloadffmpeg-12d82004c51f46464a032e9081879945cf495a25.tar.gz
concatdec: store eof condition in context
This is needed later for outpoint support which may leave the last file in a not-eof state. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavformat/concatdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 685b157352..a34e1a0242 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -57,6 +57,7 @@ typedef struct {
AVFormatContext *avf;
int safe;
int seekable;
+ int eof;
ConcatMatchMode stream_match_mode;
unsigned auto_convert;
} ConcatContext;
@@ -447,8 +448,10 @@ static int open_next_file(AVFormatContext *avf)
cat->cur_file->duration -= (cat->cur_file->inpoint - cat->cur_file->file_start_time);
}
- if (++fileno >= cat->nb_files)
+ if (++fileno >= cat->nb_files) {
+ cat->eof = 1;
return AVERROR_EOF;
+ }
return open_file(avf, fileno);
}
@@ -500,6 +503,9 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
ConcatStream *cs;
AVStream *st;
+ if (cat->eof)
+ return AVERROR_EOF;
+
if (!cat->avf)
return AVERROR(EIO);
@@ -631,6 +637,7 @@ static int concat_seek(AVFormatContext *avf, int stream,
cat->cur_file = cur_file_saved;
} else {
avformat_close_input(&cur_avf_saved);
+ cat->eof = 0;
}
return ret;
}