lavf: add FFERROR_REDO to let demuxers return no packet.

This commit is contained in:
Nicolas George
2015-11-27 18:57:27 +01:00
parent 64f7db554e
commit 3ab1e5a48c
2 changed files with 11 additions and 0 deletions

View File

@@ -680,6 +680,11 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
av_init_packet(pkt);
ret = s->iformat->read_packet(s, pkt);
if (ret < 0) {
/* Some demuxers return FFERROR_REDO when they consume
data and discard it (ignored streams, junk, extradata).
We must re-call the demuxer to get the real packet. */
if (ret == FFERROR_REDO)
continue;
if (!pktl || ret == AVERROR(EAGAIN))
return ret;
for (i = 0; i < s->nb_streams; i++) {