flacdec: Use new channel count for audio info
authorJochen Henneberg <jh@henneberg-systemdesign.com>
Sat, 27 Oct 2018 11:41:46 +0000 (13:41 +0200)
committerSebastian Dröge <slomo@coaxion.net>
Fri, 14 Dec 2018 09:22:33 +0000 (09:22 +0000)
ext/flac/gstflacdec.c

index b76b724854ef801a69eadcfc950f19e7c2725238..a1104dc6eb7abc6707bd053669ff2a0acf46b4b9 100644 (file)
@@ -633,10 +633,8 @@ gst_flac_dec_write (GstFlacDec * flacdec, const FLAC__Frame * frame,
     GST_DEBUG_OBJECT (flacdec, "Negotiating %d Hz @ %d channels", sample_rate,
         channels);
 
-    memcpy (chanpos, channel_positions[flacdec->info.channels - 1],
-        sizeof (chanpos));
-    gst_audio_channel_positions_to_valid_order (chanpos,
-        flacdec->info.channels);
+    memcpy (chanpos, channel_positions[channels - 1], sizeof (chanpos));
+    gst_audio_channel_positions_to_valid_order (chanpos, channels);
     gst_audio_info_set_format (&flacdec->info,
         gst_audio_format_build_integer (TRUE, G_BYTE_ORDER, width, gdepth),
         sample_rate, channels, chanpos);