[FFmpeg-cvslog] tty: return EOF when the 'effective' end of file is reached. ('effective' because ansi/tty files may be concatenated with SAUCE/EFI metadata)

Peter Ross git at videolan.org
Tue Sep 4 06:16:34 CEST 2012


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sun Sep  2 17:37:11 2012 +1000| [bf959ac2c68111449cfdfb550a08ef37a537c994] | committer: Michael Niedermayer

tty: return EOF when the 'effective' end of file is reached. ('effective' because ansi/tty files may be concatenated with SAUCE/EFI metadata)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/tty.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/tty.c b/libavformat/tty.c
index b86dd79..a71c6b1 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -128,6 +128,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
     if (s->fsize) {
         // ignore metadata buffer
         uint64_t p = avio_tell(avctx->pb);
+        if (p == s->fsize)
+            return AVERROR_EOF;
         if (p + s->chars_per_frame > s->fsize)
             n = s->fsize - p;
     }



More information about the ffmpeg-cvslog mailing list