From 8fd3e0e125f2e77d9b9df15c78ad27ca9dce8f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Sat, 30 May 2015 17:41:05 -0400 Subject: [PATCH] mulawdec: Let baseclass estimate bitrate This makes playback directly from a file work with the right caps. --- gst/law/mulaw-decode.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst/law/mulaw-decode.c b/gst/law/mulaw-decode.c index 02ccd4bfa7..a4bd0a644b 100644 --- a/gst/law/mulaw-decode.c +++ b/gst/law/mulaw-decode.c @@ -135,6 +135,14 @@ error_failed_map_input_buffer: return GST_FLOW_ERROR; } +static gboolean +gst_mulawdec_start (GstAudioDecoder * dec) +{ + gst_audio_decoder_set_estimate_rate (dec, TRUE); + + return TRUE; +} + static void gst_mulawdec_class_init (GstMuLawDecClass * klass) { @@ -147,6 +155,7 @@ gst_mulawdec_class_init (GstMuLawDecClass * klass) gst_static_pad_template_get (&mulaw_dec_sink_factory)); + audiodec_class->start = GST_DEBUG_FUNCPTR (gst_mulawdec_start); audiodec_class->set_format = GST_DEBUG_FUNCPTR (gst_mulawdec_set_format); audiodec_class->handle_frame = GST_DEBUG_FUNCPTR (gst_mulawdec_handle_frame);