[FFmpeg-devel] [PATCH 2/6] avformat/s337m: Consider container bit resolution

Tomas Härdin git at haerdin.se
Thu Feb 16 12:36:33 EET 2023


mån 2023-02-13 klockan 19:09 +0100 skrev Nicolas Gaullier:
> Prepare the support of s337m in muxers other than raw (ex: wav).
> For example, this forbids reading 16 bits DolbyE stream from a 24 bit
> wav file.
> ---
>  libavformat/s337m.c | 21 +++++++++++++++------
>  libavformat/s337m.h |  3 ++-
>  2 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/libavformat/s337m.c b/libavformat/s337m.c
> index 582c8b3670..2a566e3cba 100644
> --- a/libavformat/s337m.c
> +++ b/libavformat/s337m.c
> @@ -35,7 +35,7 @@
>  
>  static int s337m_get_offset_and_codec(void *avc,
>                                        uint64_t state,
> -                                      int data_type, int data_size,
> +                                      int data_type, int data_size,
> int container_word_bits,
>                                        int *offset, enum AVCodecID
> *codec)
>  {
>      int word_bits;
> @@ -56,6 +56,12 @@ static int s337m_get_offset_and_codec(void *avc,
>              avpriv_report_missing_feature(avc, "Data type %#x in
> SMPTE 337M", data_type & 0x1F);
>          return AVERROR_PATCHWELCOME;
>      }
> +    if (container_word_bits &&
> +        !(container_word_bits == 16 && word_bits == 16) &&
> +        !(container_word_bits == 24 && word_bits == 20) &&

I presume 20/24 is intentional. Does WAV not support signalling 20-bit?

The rest looks OK enough

/Tomas



More information about the ffmpeg-devel mailing list