opusdec: remove artificial restriction on rate negotiation
authorThiago Santos <thiagoss@osg.samsung.com>
Mon, 2 May 2016 13:21:52 +0000 (10:21 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Mon, 2 May 2016 17:29:25 +0000 (14:29 -0300)
Remove restrictions when rate is 48000, the underlying lib supports
converting any of the input to any of the output rates.

https://bugzilla.gnome.org/show_bug.cgi?id=765684

ext/opus/gstopusdec.c

index 28101aa..90301e0 100644 (file)
@@ -237,22 +237,6 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
     GstCaps *constraint, *inter;
 
     constraint = gst_caps_from_string ("audio/x-raw");
-    if (dec->sample_rate == 0 || dec->sample_rate == 48000) {
-      gst_caps_set_simple (constraint, "rate", G_TYPE_INT, 48000, NULL);
-    } else {
-      GValue v = { 0 }
-      , l = {
-      0};
-      g_value_init (&l, GST_TYPE_LIST);
-      g_value_init (&v, G_TYPE_INT);
-      g_value_set_int (&v, dec->sample_rate);
-      gst_value_list_append_value (&l, &v);
-      g_value_set_int (&v, 48000);
-      gst_value_list_append_value (&l, &v);
-      gst_caps_set_value (constraint, "rate", &l);
-      g_value_unset (&v);
-      g_value_unset (&l);
-    }
     if (dec->n_channels <= 2) { /* including 0 */
       gst_caps_set_simple (constraint, "channels", GST_TYPE_INT_RANGE, 1, 2,
           NULL);