avauddec: Read channels from the channels field
authorOlivier Crete <olivier.crete@collabora.com>
Sat, 25 Jul 2015 06:54:20 +0000 (02:54 -0400)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Mon, 27 Jul 2015 18:18:32 +0000 (14:18 -0400)
If there is no layout, just read the channel count from the
channels field.

https://bugzilla.gnome.org/show_bug.cgi?id=752186

ext/libav/gstavauddec.c

index 360d168..17eb773 100644 (file)
@@ -381,6 +381,8 @@ gst_ffmpegauddec_negotiate (GstFFMpegAudDec * ffmpegdec,
   channels =
       av_get_channel_layout_nb_channels (av_frame_get_channel_layout (frame));
   if (channels == 0)
+    channels = av_frame_get_channels (frame);
+  if (channels == 0)
     goto no_caps;
 
   if (!force && !settings_changed (ffmpegdec, frame))