# HG changeset patch # User michael # Date 1265811957 0 # Node ID 747753995dee4ea8e9be367b15b5d5cb1177d6ca # Parent 980dc98901d93bb6c640ca426e4a58d2d20a4a12 Dont give up after 100kb of zero bytes but returnd EAGAIN fixes issue1729 diff -r 980dc98901d9 -r 747753995dee mpeg.c --- a/mpeg.c Wed Feb 10 12:44:16 2010 +0000 +++ b/mpeg.c Wed Feb 10 14:25:57 2010 +0000 @@ -247,8 +247,13 @@ startcode = find_next_start_code(s->pb, &size, &m->header_state); last_sync = url_ftell(s->pb); //printf("startcode=%x pos=0x%"PRIx64"\n", startcode, url_ftell(s->pb)); - if (startcode < 0) - return AVERROR(EIO); + if (startcode < 0){ + if(url_feof(s->pb)) + return AVERROR_EOF; + //FIXME we should remember header_state + return AVERROR(EAGAIN); + } + if (startcode == PACK_START_CODE) goto redo; if (startcode == SYSTEM_HEADER_START_CODE)