1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

mpegts: propagate avio EOF in read_packet()

Allows distinguishing between EOF and IO error in read_packet return code.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Jindrich Makovicka 2011-03-31 16:58:50 +02:00 committed by Anton Khirnov
parent 1c69c79f2b
commit e006d71fa8

View File

@ -1350,7 +1350,7 @@ static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size)
for(;;) { for(;;) {
len = avio_read(pb, buf, TS_PACKET_SIZE); len = avio_read(pb, buf, TS_PACKET_SIZE);
if (len != TS_PACKET_SIZE) if (len != TS_PACKET_SIZE)
return AVERROR(EIO); return len < 0 ? len : AVERROR_EOF;
/* check paquet sync byte */ /* check paquet sync byte */
if (buf[0] != 0x47) { if (buf[0] != 0x47) {
/* find a new packet start */ /* find a new packet start */