Commit a308737b authored by Michael Niedermayer's avatar Michael Niedermayer

Use EAGAIN return, primarely intended as example of EAGAIN useage.

Originally committed as revision 16719 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent cda6902d
...@@ -309,7 +309,6 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -309,7 +309,6 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t dts, pts = AV_NOPTS_VALUE; int64_t dts, pts = AV_NOPTS_VALUE;
AVStream *st = NULL; AVStream *st = NULL;
retry:
for(;;){ for(;;){
pos = url_ftell(s->pb); pos = url_ftell(s->pb);
url_fskip(s->pb, 4); /* size of previous packet */ url_fskip(s->pb, 4); /* size of previous packet */
...@@ -345,7 +344,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -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); av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
skip: skip:
url_fseek(s->pb, next, SEEK_SET); url_fseek(s->pb, next, SEEK_SET);
continue; return AVERROR(EAGAIN);
} }
/* skip empty data packets */ /* skip empty data packets */
...@@ -369,7 +368,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -369,7 +368,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|| st->discard >= AVDISCARD_ALL || st->discard >= AVDISCARD_ALL
){ ){
url_fseek(s->pb, next, SEEK_SET); url_fseek(s->pb, next, SEEK_SET);
continue; return AVERROR(EAGAIN);
} }
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY) if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME); av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);
...@@ -420,7 +419,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -420,7 +419,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
if (type == 0) { if (type == 0) {
if ((ret = flv_get_extradata(s, st, size)) < 0) if ((ret = flv_get_extradata(s, st, size)) < 0)
return ret; return ret;
goto retry; return AVERROR(EAGAIN);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment