From e006d71fa849542eb27146efac629288703b3d75 Mon Sep 17 00:00:00 2001 From: Jindrich Makovicka Date: Thu, 31 Mar 2011 16:58:50 +0200 Subject: [PATCH] mpegts: propagate avio EOF in read_packet() Allows distinguishing between EOF and IO error in read_packet return code. Signed-off-by: Jindrich Makovicka Signed-off-by: Anton Khirnov --- libavformat/mpegts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index abdb000445..62e9dcbbd9 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1350,7 +1350,7 @@ static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size) for(;;) { len = avio_read(pb, buf, TS_PACKET_SIZE); if (len != TS_PACKET_SIZE) - return AVERROR(EIO); + return len < 0 ? len : AVERROR_EOF; /* check paquet sync byte */ if (buf[0] != 0x47) { /* find a new packet start */