avauddec: Check planar-ness of frame rather than context

The check seems to be to present to verify that the decoded frame
matches the format we expect. The actual check for the layout of the
frame was being performed against the context instead.

The check fails at least for avdec_aptx_hd, where the AVCodecContext has
the sample format set to AV_SAMPLE_FMT_NONE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/107>
This commit is contained in:
Arun Raghavan 2020-10-27 06:33:29 -04:00
parent 15d90f1bf9
commit b6acd99239

View file

@ -492,7 +492,7 @@ gst_ffmpegauddec_audio_frame (GstFFMpegAudDec * ffmpegdec,
channels = ffmpegdec->info.channels;
nsamples = ffmpegdec->frame->nb_samples;
byte_per_sample = ffmpegdec->info.finfo->width / 8;
planar = av_sample_fmt_is_planar (ffmpegdec->context->sample_fmt);
planar = av_sample_fmt_is_planar (ffmpegdec->frame->format);
g_return_val_if_fail (ffmpegdec->info.layout == (planar ?
GST_AUDIO_LAYOUT_NON_INTERLEAVED : GST_AUDIO_LAYOUT_INTERLEAVED),