diff options
author | Nicolas George <george@nsup.org> | 2015-11-27 18:57:27 +0100 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2015-12-03 19:16:12 +0100 |
commit | 3ab1e5a48c53fdecdf50d177d20b6476094cec68 (patch) | |
tree | 57e7b466084caf2b500ed854d5a967581e3d8239 /libavformat/utils.c | |
parent | 64f7db554ee83846f207e82a08946a6a5a6acfe2 (diff) | |
download | ffmpeg-3ab1e5a48c53fdecdf50d177d20b6476094cec68.tar.gz |
lavf: add FFERROR_REDO to let demuxers return no packet.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 973256f2f2..e93a1920c9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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++) { |