From 2cddf3a0a9008bf78f9c418bc6d87843a0627eab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 8 Jan 2014 09:46:55 +0100 Subject: [PATCH] matroskamux: Error out if ADPCM caps don't contain the layout field --- gst/matroska/matroska-mux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index d42334b..53aa533 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -1944,11 +1944,18 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps) bitrate = block_align * samplerate; } else if (!strcmp (mimetype, "audio/x-adpcm")) { const char *layout; + layout = gst_structure_get_string (structure, "layout"); + if (!layout) { + GST_WARNING_OBJECT (mux, "Missing layout on adpcm caps"); + goto refuse_caps; + } + if (!gst_structure_get_int (structure, "block_align", &block_align)) { GST_WARNING_OBJECT (mux, "Missing block_align on adpcm caps"); goto refuse_caps; } + if (!strcmp (layout, "dvi")) { format = GST_RIFF_WAVE_FORMAT_DVI_ADPCM; } else if (!strcmp (layout, "g726")) { -- 2.7.4