}
ret = ff_qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->input_ref);
- if (ret < 0)
+ if (ret < 0) {
+ /* Drop input packet when failed to decode the packet. Otherwise,
+ the decoder will keep decoding the failure packet. */
+ av_packet_unref(&s->input_ref);
+
return ret;
+ }
s->input_ref.size -= ret;
s->input_ref.data += ret;
#define OFFSET(x) offsetof(QSVOtherContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
- { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
+ { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VD },
{ NULL },
};