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>
This commit is contained in:
Zohar Kelrich
2011-07-24 17:28:33 +03:00
committed by Luca Barbato
parent 5081514269
commit 73e8e8dbf9
3 changed files with 11 additions and 0 deletions

View File

@ -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){