[FFmpeg-devel] [PATCH 5/9] avformat/wavdec: s337m support
Tomas Härdin
tjoppen at acc.umu.se
Sun Jan 12 22:33:03 EET 2020
fre 2020-01-03 klockan 16:56 +0100 skrev Nicolas Gaullier:
> Add s337m probing/reading similarly to spdif.
> Add a new AVOption 'dolbyeprobe' to enable it.
> ---
> libavformat/wavdec.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
>
> -static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav)
> +static void set_spdif_s337m(AVFormatContext *s, WAVDemuxContext *wav)
> {
> - if (CONFIG_SPDIF_DEMUXER && s->streams[0]->codecpar->codec_tag == 1) {
> + AVCodecParameters *par = s->streams[0]->codecpar;
> + if ((CONFIG_SPDIF_DEMUXER || CONFIG_S337M_DEMUXER) && par->codec_tag == 1) {
> enum AVCodecID codec;
> int len = 1<<16;
> int ret = ffio_ensure_seekback(s->pb, len);
> @@ -80,6 +84,12 @@ static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav)
> if (ret > AVPROBE_SCORE_EXTENSION) {
> s->streams[0]->codecpar->codec_id = codec;
> wav->spdif = 1;
> + } else if (wav->s337m_probe && (par->codec_id == AV_CODEC_ID_PCM_S16LE || par->codec_id == AV_CODEC_ID_PCM_S24LE) && par->channels == 2) {
> + ret = ff_s337m_probe(buf, len, &codec, s, par->bits_per_coded_sample);
Might want to check bits_per_coded_sample before calling
ff_s337m_probe(), or in the probe function itself, since it divides by
it.
The rest looks OK
/Tomas
More information about the ffmpeg-devel
mailing list