diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-01-22 12:08:06 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-01-22 12:08:06 +0000 |
commit | a308737bd66a1c669b9be71a1b834d8419fe70ca (patch) | |
tree | 5d52732084f43393835076b97f669fef497a72e4 /libavformat/flvdec.c | |
parent | cda6902d36772edfa700d8c0572e6ac5e9c57503 (diff) | |
download | ffmpeg-a308737bd66a1c669b9be71a1b834d8419fe70ca.tar.gz |
Use EAGAIN return, primarely intended as example of EAGAIN useage.
Originally committed as revision 16719 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r-- | libavformat/flvdec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 5fee6b70af..ec9b471f48 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -309,7 +309,6 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) int64_t dts, pts = AV_NOPTS_VALUE; AVStream *st = NULL; - retry: for(;;){ pos = url_ftell(s->pb); url_fskip(s->pb, 4); /* size of previous packet */ @@ -345,7 +344,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags); skip: url_fseek(s->pb, next, SEEK_SET); - continue; + return AVERROR(EAGAIN); } /* skip empty data packets */ @@ -369,7 +368,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) || st->discard >= AVDISCARD_ALL ){ url_fseek(s->pb, next, SEEK_SET); - continue; + return AVERROR(EAGAIN); } if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY) av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME); @@ -420,7 +419,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) if (type == 0) { if ((ret = flv_get_extradata(s, st, size)) < 0) return ret; - goto retry; + return AVERROR(EAGAIN); } } |