[FFmpeg-devel] [PATCH] swresample fixes

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Jan 4 19:26:23 EET 2023


Paul B Mahol:
> diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
> index 7923377c8c..2744388f75 100644
> --- a/libavfilter/af_aresample.c
> +++ b/libavfilter/af_aresample.c
> @@ -209,8 +209,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      } else {
>          outsamplesref->pts  = AV_NOPTS_VALUE;
>      }
> +again:
>      ret = swr_convert_frame(aresample->swr, outsamplesref,
>                              (void *)insamplesref);
> +    if (ret & (AVERROR_INPUT_CHANGED | AVERROR_OUTPUT_CHANGED)) {

This is wrong: There are lots of errors besides AVERROR_INPUT_CHANGED,
AVERROR_OUTPUT_CHANGED and AVERROR_INPUT_CHANGED |
AVERROR_OUTPUT_CHANGED for which this condition is true. See also ticket
#9343.

> +        swr_close(aresample->swr);
> +        goto again;
> +    }
> +
>      if (ret < 0) {
>          av_frame_free(&outsamplesref);
>          av_frame_free(&insamplesref);




More information about the ffmpeg-devel mailing list