amrnbdec: Use gst_audio_decoder_set_needs_format() instead of custom code
authorSebastian Dröge <sebastian@centricular.com>
Thu, 5 Dec 2013 11:09:04 +0000 (12:09 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 5 Dec 2013 11:09:04 +0000 (12:09 +0100)
ext/amrnb/amrnbdec.c

index f82b8ccc833b45e10c3e9cd741fc361a6e22a68f..81741db40e2ce912dcc513073cf68f0ce89a6d52 100644 (file)
@@ -143,6 +143,7 @@ gst_amrnbdec_class_init (GstAmrnbDecClass * klass)
 static void
 gst_amrnbdec_init (GstAmrnbDec * amrnbdec)
 {
+  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrnbdec), TRUE);
 }
 
 static gboolean
@@ -289,9 +290,6 @@ gst_amrnbdec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
   if (!buffer || !gst_buffer_get_size (buffer))
     return GST_FLOW_OK;
 
-  if (amrnbdec->rate == 0 || amrnbdec->channels == 0)
-    goto not_negotiated;
-
   gst_buffer_map (buffer, &inmap, GST_MAP_READ);
 
   /* get output */