[FFmpeg-cvslog] ffmdec: only seek back at EOF if a server is attached

Andreas Cadhalpun git at videolan.org
Fri Dec 4 15:20:53 CET 2015


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Wed Dec  2 22:25:55 2015 +0100| [488e9a06f014222720deafc48f43d9bd1973ba97] | committer: Andreas Cadhalpun

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 at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=488e9a06f014222720deafc48f43d9bd1973ba97
---

 libavformat/ffmdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index e7c1449..9ad771e 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);



More information about the ffmpeg-cvslog mailing list