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>
This commit is contained in:
parent
6d1801b5aa
commit
3496a20bb9
@ -832,8 +832,10 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0) {
|
||||||
continue;
|
ret = AVERROR(EAGAIN);
|
||||||
|
goto leave;
|
||||||
|
}
|
||||||
|
|
||||||
next = size + avio_tell(s->pb);
|
next = size + avio_tell(s->pb);
|
||||||
|
|
||||||
@ -876,12 +878,15 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
type, size, flags);
|
type, size, flags);
|
||||||
skip:
|
skip:
|
||||||
avio_seek(s->pb, next, SEEK_SET);
|
avio_seek(s->pb, next, SEEK_SET);
|
||||||
continue;
|
ret = AVERROR(EAGAIN);
|
||||||
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip empty data packets */
|
/* skip empty data packets */
|
||||||
if (!size)
|
if (!size) {
|
||||||
continue;
|
ret = AVERROR(EAGAIN);
|
||||||
|
goto leave;
|
||||||
|
}
|
||||||
|
|
||||||
/* now find stream */
|
/* now find stream */
|
||||||
for (i = 0; i < s->nb_streams; i++) {
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
@ -919,7 +924,8 @@ skip:
|
|||||||
|| st->discard >= AVDISCARD_ALL
|
|| st->discard >= AVDISCARD_ALL
|
||||||
) {
|
) {
|
||||||
avio_seek(s->pb, next, SEEK_SET);
|
avio_seek(s->pb, next, SEEK_SET);
|
||||||
continue;
|
ret = AVERROR(EAGAIN);
|
||||||
|
goto leave;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user