diff options
author | Zohar Kelrich <lumimies@gmail.com> | 2011-07-24 17:28:33 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2011-08-02 02:52:41 +0200 |
commit | 73e8e8dbf969b9a0bc1591abcfeba474a42e47bc (patch) | |
tree | 853e79fdfbab27c1be31fff674a1fe215ea2faeb /libavformat/utils.c | |
parent | 5081514269a17809f8a8ff71e6b26e4b761e8266 (diff) | |
download | ffmpeg-73e8e8dbf969b9a0bc1591abcfeba474a42e47bc.tar.gz |
lavf: Add an option to discard corrupted frames
Signed-off-by: Zohar Kelrich <lumimies@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index c4d7623c8c..b848ebb827 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -719,6 +719,15 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt) s->streams[i]->probe_packets = 0; continue; } + + if ((s->flags & AVFMT_FLAG_DISCARD_CORRUPT) && + (pkt->flags & AV_PKT_FLAG_CORRUPT)) { + av_log(s, AV_LOG_WARNING, + "Dropped corrupted packet (stream = %d)\n", + pkt->stream_index); + continue; + } + st= s->streams[pkt->stream_index]; switch(st->codec->codec_type){ |