diff options
author | Ami Fischman <fischman@chromium.org> | 2011-06-29 13:50:21 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-29 15:27:55 -0700 |
commit | 59ca3955fbe13401bf49d456562264267d9991fe (patch) | |
tree | e9bb0b48068a206d45db1094676eba550a910c28 | |
parent | 98add74e85967441d6b7263d1eee79aa2d98cd82 (diff) | |
download | ffmpeg-59ca3955fbe13401bf49d456562264267d9991fe.tar.gz |
av_find_stream_info: simplify EAGAIN handling.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 7370c60bdf..b12f785565 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2306,7 +2306,10 @@ 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 < 0 && ret != AVERROR(EAGAIN)) { + if (ret == AVERROR(EAGAIN)) + continue; + + if (ret < 0) { /* EOF or error */ ret = -1; /* we could not have all the codec parameters before EOF */ for(i=0;i<ic->nb_streams;i++) { @@ -2322,9 +2325,6 @@ int av_find_stream_info(AVFormatContext *ic) break; } - if (ret == AVERROR(EAGAIN)) - continue; - pkt= add_to_pktbuf(&ic->packet_buffer, &pkt1, &ic->packet_buffer_end); if ((ret = av_dup_packet(pkt)) < 0) goto find_stream_info_err; |