tty: return EOF when the 'effective' end of file is reached. ('effective' because...
authorPeter Ross <pross@xvid.org>
Sun, 2 Sep 2012 07:37:11 +0000 (17:37 +1000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Sep 2012 04:12:10 +0000 (06:12 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/tty.c

index b86dd79..a71c6b1 100644 (file)
@@ -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;
     }