From d98b996523b07599c294a2a66762bca5c03d1cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 26 Jun 2014 13:43:33 +0100 Subject: [PATCH] flvmux: fix speex in FLV Speex in FLV is always mono @ 16kHz, see http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf section E.4.2.1: "If the SoundFormat indicates Speex, the audio is compressed mono sampled at 16 kHz, the SoundRate shall be 0, the SoundSize shall be 1, and the SoundType shall be 0" Also see https://bugzilla.gnome.org/show_bug.cgi?id=683622 --- gst/flv/gstflvmux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/flv/gstflvmux.c b/gst/flv/gstflvmux.c index 9b11b4b93c..1d3ab9bbff 100644 --- a/gst/flv/gstflvmux.c +++ b/gst/flv/gstflvmux.c @@ -81,7 +81,7 @@ static GstStaticPadTemplate audiosink_templ = GST_STATIC_PAD_TEMPLATE ("audio", "audio/x-raw, format = (string) { U8, S16LE}, layout = (string) interleaved, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; " "audio/x-alaw, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; " "audio/x-mulaw, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; " - "audio/x-speex, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 };") + "audio/x-speex, channels = (int) 1, rate = (int) 16000;") ); #define gst_flv_mux_parent_class parent_class @@ -464,7 +464,8 @@ gst_flv_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps) else if (rate == 8000 && (cpad->audio_codec == 5 || cpad->audio_codec == 14)) cpad->rate = 0; - else if (rate == 16000 && cpad->audio_codec == 4) + else if (rate == 16000 && (cpad->audio_codec == 4 + || cpad->audio_codec == 11)) cpad->rate = 0; else ret = FALSE; @@ -476,7 +477,7 @@ gst_flv_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps) if (gst_structure_get_int (s, "channels", &channels)) { if (cpad->audio_codec == 4 || cpad->audio_codec == 5 - || cpad->audio_codec == 6) + || cpad->audio_codec == 6 || cpad->audio_codec == 11) cpad->channels = 0; else if (cpad->audio_codec == 10) cpad->channels = 1;