summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-16 01:39:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-16 03:32:27 +0200
commit3496a20bb92570aaa82849f0d5409f2e29fe2d2b (patch)
treed9a94f1369c45eb06b0842f2d8f7af24e03a7395 /libavformat
parent6d1801b5aaf9b384e13adffff4ab5886dae65693 (diff)
avformat/flvdec: Change packet loop to return EAGAIN instead of looping until a valid packet is foud
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvdec.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 826e0d7ea2..cec40e0250 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -832,8 +832,10 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
}
}
- if (size == 0)
- continue;
+ if (size == 0) {
+ ret = AVERROR(EAGAIN);
+ goto leave;
+ }
next = size + avio_tell(s->pb);
@@ -876,12 +878,15 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
type, size, flags);
skip:
avio_seek(s->pb, next, SEEK_SET);
- continue;
+ ret = AVERROR(EAGAIN);
+ goto leave;
}
/* skip empty data packets */
- if (!size)
- continue;
+ if (!size) {
+ ret = AVERROR(EAGAIN);
+ goto leave;
+ }
/* now find stream */
for (i = 0; i < s->nb_streams; i++) {
@@ -919,7 +924,8 @@ skip:
|| st->discard >= AVDISCARD_ALL
) {
avio_seek(s->pb, next, SEEK_SET);
- continue;
+ ret = AVERROR(EAGAIN);
+ goto leave;
}
break;
}