adpcmdec: fix up for GstAudioDecoder API change
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 1 Feb 2012 17:06:11 +0000 (17:06 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 1 Feb 2012 17:06:11 +0000 (17:06 +0000)
gst/adpcmdec/adpcmdec.c

index 3f5824c7bf4dba114925621bdeedbea6bcf1ea4c..3b4f47fea825a4bbaf2c61516a014af50a055c5c 100644 (file)
@@ -89,7 +89,7 @@ adpcmdec_set_format (GstAudioDecoder * bdec, GstCaps * in_caps)
   ADPCMDec *dec = (ADPCMDec *) (bdec);
   GstStructure *structure = gst_caps_get_structure (in_caps, 0);
   const gchar *layout;
-  GstCaps *caps;
+  GstAudioInfo info;
 
   layout = gst_structure_get_string (structure, "layout");
   if (!layout)
@@ -110,15 +110,11 @@ adpcmdec_set_format (GstAudioDecoder * bdec, GstCaps * in_caps)
   if (!gst_structure_get_int (structure, "channels", &dec->channels))
     return FALSE;
 
-  caps = gst_caps_new_simple ("audio/x-raw",
-      "format", G_TYPE_STRING, GST_AUDIO_NE (S16),
-      "layout", G_TYPE_STRING, "interleaved",
-      "rate", G_TYPE_INT, dec->rate,
-      "channels", G_TYPE_INT, dec->channels, NULL);
-
-  gst_audio_decoder_set_outcaps (bdec, caps);
-  gst_caps_unref (caps);
+  gst_audio_info_init (&info);
+  gst_audio_info_set_format (&info, GST_AUDIO_FORMAT_S16, dec->rate,
+      dec->channels, NULL);
 
+  gst_audio_decoder_set_output_format (bdec, &info);
   return TRUE;
 }