diff mbox series

[FFmpeg-devel,1/2] lavc/qsvdec: return 0 if more data is required

Message ID 20231127060151.2435971-1-haihao.xiang@intel.com
State Accepted
Commit e233f3e75fda8dd60a3dc5f55b7a4bd32b238b6a
Headers show
Series [FFmpeg-devel,1/2] lavc/qsvdec: return 0 if more data is required | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Xiang, Haihao Nov. 27, 2023, 6:01 a.m. UTC
From: Haihao Xiang <haihao.xiang@intel.com>

The type of qsv decoders is FF_CODEC_CB_TYPE_DECODE which must not
return AVERROR(EAGAIN). commit 42b20c9 added an assertion to check the
returned value.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavcodec/qsvdec.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Xiang, Haihao Dec. 4, 2023, 4:20 a.m. UTC | #1
On Ma, 2023-11-27 at 14:01 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang <haihao.xiang@intel.com>
> 
> The type of qsv decoders is FF_CODEC_CB_TYPE_DECODE which must not
> return AVERROR(EAGAIN). commit 42b20c9 added an assertion to check the
> returned value.
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavcodec/qsvdec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index da700f25e9..b501964089 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -1076,6 +1076,9 @@ static int qsv_decode_frame(AVCodecContext *avctx,
> AVFrame *frame,
>  
>          ret = qsv_process_data(avctx, &s->qsv, frame, got_frame, &s-
> >buffer_pkt);
>          if (ret < 0){
> +            if (ret == AVERROR(EAGAIN))
> +                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);

Will apply the patchset, 

Thanks
Haihao
diff mbox series

Patch

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index da700f25e9..b501964089 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -1076,6 +1076,9 @@  static int qsv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
         ret = qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->buffer_pkt);
         if (ret < 0){
+            if (ret == AVERROR(EAGAIN))
+                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);