summaryrefslogtreecommitdiff
path: root/libavformat/tty.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2012-09-02 17:37:11 +1000
committerMichael Niedermayer <michaelni@gmx.at>2012-09-04 06:12:10 +0200
commitbf959ac2c68111449cfdfb550a08ef37a537c994 (patch)
tree2252093b9d8f0c9c6fdd2173c37213225197827d /libavformat/tty.c
parent688cb7125274e3b651ec2113ffe5a68dea8d9bf1 (diff)
downloadffmpeg-bf959ac2c68111449cfdfb550a08ef37a537c994.tar.gz
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@gmx.at>
Diffstat (limited to 'libavformat/tty.c')
-rw-r--r--libavformat/tty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/tty.c b/libavformat/tty.c
index b86dd79ca0..a71c6b1939 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;
}