From 6628d20eac4f4a316b593a27a5700c5d393ba68a Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Tue, 18 May 2010 15:27:06 -0400 Subject: [PATCH] speex: fix latency query Speex should report 30 ms latency for narrowband mode, 34 otherwise. Fixes #619018 --- ext/speex/gstspeexenc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index f0b257eff..dff02e0fc 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -410,7 +410,11 @@ gst_speex_enc_convert_sink (GstPad * pad, GstFormat src_format, static gint64 gst_speex_enc_get_latency (GstSpeexEnc * enc) { - return 30 * GST_MSECOND; + /* See the Speex manual section "Latency and algorithmic delay" */ + if (enc->rate == 8000) + return 30 * GST_MSECOND; + else + return 34 * GST_MSECOND; } static const GstQueryType * -- GitLab