[FFmpeg-devel] [PATCH 1/2] avcodec/ac3dec: don't export Matrix Encoding side data when no such info is coded

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Jan 13 09:09:05 EET 2023


James Almer:
> No point inserting the side data to all frames just to say there's no
> coded matrix encoding.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/ac3dec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
> index 0b120e6140..7a84f3c85d 100644
> --- a/libavcodec/ac3dec.c
> +++ b/libavcodec/ac3dec.c
> @@ -1819,7 +1819,8 @@ skip:
>              break;
>          }
>      }
> -    if ((ret = ff_side_data_update_matrix_encoding(frame, matrix_encoding)) < 0)
> +    if (matrix_encoding != AV_MATRIX_ENCODING_NONE &&
> +        (ret = ff_side_data_update_matrix_encoding(frame, matrix_encoding)) < 0)
>          return ret;
>  
>      /* AVDownmixInfo */

If the preceding frame had a nontrivial matrix encoding, will users
think that the matrix encoding from the last frame still persists?

- Andreas



More information about the ffmpeg-devel mailing list