[FFmpeg-devel] [PATCH 1/2] 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 pross at xvid.org
Sun Sep 2 09:37:11 CEST 2012


---
 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;
     }
-- 
1.7.10.4

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120902/1bf400d2/attachment.asc>


More information about the ffmpeg-devel mailing list