diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-01-22 12:06:02 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-01-22 12:06:02 +0000 |
commit | cda6902d36772edfa700d8c0572e6ac5e9c57503 (patch) | |
tree | 7c6a32caf9f0d3eb312901a4e73b57d82cba0278 /libavformat | |
parent | ad51c68c011526d856dc02b53fb5f3708efb677c (diff) | |
download | ffmpeg-cda6902d36772edfa700d8c0572e6ac5e9c57503.tar.gz |
Handle av_read_frame() EAGAIN return.
Originally committed as revision 16718 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d3374b8093..b49fadcce2 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1493,7 +1493,10 @@ static int av_seek_frame_generic(AVFormatContext *s, return ret; } for(i=0;; i++) { - int ret = av_read_frame(s, &pkt); + int ret; + do{ + ret = av_read_frame(s, &pkt); + }while(ret == AVERROR(EAGAIN)); if(ret<0) break; av_free_packet(&pkt); @@ -1718,7 +1721,9 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset if (i == ic->nb_streams) break; - ret = av_read_packet(ic, pkt); + do{ + ret = av_read_packet(ic, pkt); + }while(ret == AVERROR(EAGAIN)); if (ret != 0) break; read_size += pkt->size; @@ -1743,7 +1748,9 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset if (read_size >= DURATION_MAX_READ_SIZE) break; - ret = av_read_packet(ic, pkt); + do{ + ret = av_read_packet(ic, pkt); + }while(ret == AVERROR(EAGAIN)); if (ret != 0) break; read_size += pkt->size; @@ -2044,6 +2051,8 @@ int av_find_stream_info(AVFormatContext *ic) /* NOTE: a new stream can be added there if no header in file (AVFMTCTX_NOHEADER) */ ret = av_read_frame_internal(ic, &pkt1); + if(ret == AVERROR(EAGAIN)) + continue; if (ret < 0) { /* EOF or error */ ret = -1; /* we could not have all the codec parameters before EOF */ |