Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-03 00:25:55 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-04 17:20:04 +0300
commit488e9a06f014222720deafc48f43d9bd1973ba97 (patch)
tree774857fa99faef5318edb380998f3b7eefffada0 /libavformat/ffmdec.c
parent3c4e49187f836c3613dc27c2c6a0d14c2d12bea8 (diff)
ffmdec: only seek back at EOF if a server is attached
Otherwise the ffm demuxer can return the same packets endlessly, if there is no server attached. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/ffmdec.c')
-rw-r--r--libavformat/ffmdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index e7c1449ea4..9ad771ea38 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -100,7 +100,10 @@ static int ffm_read_data(AVFormatContext *s,
len = size;
if (len == 0) {
if (avio_tell(pb) == ffm->file_size)
- avio_seek(pb, ffm->packet_size, SEEK_SET);
+ if (ffm->server_attached)
+ avio_seek(pb, ffm->packet_size, SEEK_SET);
+ else
+ return AVERROR_EOF;
retry_read:
if (pb->buffer_size != ffm->packet_size) {
int64_t tell = avio_tell(pb);