summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r--libavformat/flvdec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index c925e54539..9bc2517b15 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -313,6 +313,7 @@ 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 */
@@ -348,7 +349,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);
- return AVERROR(EAGAIN);
+ continue;
}
/* skip empty data packets */
@@ -372,7 +373,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|| st->discard >= AVDISCARD_ALL
){
url_fseek(s->pb, next, SEEK_SET);
- return AVERROR(EAGAIN);
+ continue;
}
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);
@@ -435,7 +436,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
st->codec->channels, st->codec->sample_rate);
}
- return AVERROR(EAGAIN);
+ goto retry;
}
}