gsmdec: fix decoding of audio/ms-gsm variant

Alternates between 33 and 32 byte frames, but must start
with a 33 byte frame. This has been broken for ages since
the element was ported to the audio decoder base class.

https://bugzilla.gnome.org/show_bug.cgi?id=709416
This commit is contained in:
Tim-Philipp Müller 2013-12-06 00:22:20 +00:00
parent 7dffa2e1f2
commit 621bf0d22e

View file

@ -192,17 +192,17 @@ gst_gsmdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
size = gst_adapter_available (adapter);
g_return_val_if_fail (size > 0, GST_FLOW_ERROR);
/* WAV49 requires alternating 33 and 32 bytes of input */
if (gsmdec->use_wav49) {
gsmdec->needed = (gsmdec->needed == 33 ? 32 : 33);
}
if (size < gsmdec->needed)
return GST_FLOW_EOS;
*offset = 0;
*length = gsmdec->needed;
/* WAV49 requires alternating 33 and 32 bytes of input */
if (gsmdec->use_wav49) {
gsmdec->needed = (gsmdec->needed == 33 ? 32 : 33);
}
return GST_FLOW_OK;
}