You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
qsv: Skip the packet if decoding failure
MediaSDK may fail to decode some frame, just skip it. Otherwise, it will keep decoding the failure packet repeatedly without processing any packet afterwards. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
committed by
Luca Barbato
parent
a2a9e4eea0
commit
559370f2c4
@@ -153,8 +153,12 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
ret = ff_qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->buffer_pkt);
|
||||
if (ret < 0)
|
||||
if (ret < 0){
|
||||
/* Drop buffer_pkt when failed to decode the packet. Otherwise,
|
||||
the decoder will keep decoding the failure packet. */
|
||||
av_packet_unref(&s->buffer_pkt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
s->buffer_pkt.size -= ret;
|
||||
s->buffer_pkt.data += ret;
|
||||
|
Reference in New Issue
Block a user