matroskademux: Always set the channel mask for PCM streams
authorThibault Saunier <tsaunier@gnome.org>
Wed, 11 Nov 2015 15:53:19 +0000 (16:53 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Mon, 21 Dec 2015 17:34:42 +0000 (18:34 +0100)
Just use the gst_audio_channel_get_fallback_mask function for now as
the specification is too complicated and nobody implements it.

gst/matroska/matroska-demux.c

index 1cd0f15..6c6933b 100644 (file)
@@ -5517,7 +5517,9 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
     /* FIXME: Channel mask and reordering */
     caps = gst_caps_new_simple ("audio/x-raw",
         "format", G_TYPE_STRING, gst_audio_format_to_string (format),
-        "layout", G_TYPE_STRING, "interleaved", NULL);
+        "layout", G_TYPE_STRING, "interleaved",
+        "channel-mask", GST_TYPE_BITMASK,
+        gst_audio_channel_get_fallback_mask (audiocontext->channels), NULL);
 
     *codec_name = g_strdup_printf ("Raw %d-bit PCM audio",
         audiocontext->bitdepth);
@@ -5532,7 +5534,9 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
     /* FIXME: Channel mask and reordering */
     caps = gst_caps_new_simple ("audio/x-raw",
         "format", G_TYPE_STRING, format,
-        "layout", G_TYPE_STRING, "interleaved", NULL);
+        "layout", G_TYPE_STRING, "interleaved",
+        "channel-mask", GST_TYPE_BITMASK,
+        gst_audio_channel_get_fallback_mask (audiocontext->channels), NULL);
     *codec_name = g_strdup_printf ("Raw %d-bit floating-point audio",
         audiocontext->bitdepth);
     context->alignment = audiocontext->bitdepth / 8;