diff options
author | Michael Niedermayer | 2010-02-10 14:25:57 +0000 |
---|---|---|
committer | Michael Niedermayer | 2010-02-10 14:25:57 +0000 |
commit | 0332324a48c8571ff30b50c194e68bf04a3e3f2b (patch) | |
tree | aac58392c1ba1ac51730c0f983a4391e17ff97d1 /libavformat/mpeg.c | |
parent | 80242f9bdb66b398a3bc05d73e30b55a43eb2a14 (diff) |
Dont give up after 100kb of zero bytes but returnd EAGAIN
fixes issue1729
Originally committed as revision 21738 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r-- | libavformat/mpeg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index d4d4d212b0..2b1cc34349 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -247,8 +247,13 @@ static int mpegps_read_pes_header(AVFormatContext *s, 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) |