mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 00:28:21 +00:00
riff: Fix G726 caps creation
https://bugzilla.gnome.org/show_bug.cgi?id=720995
This commit is contained in:
parent
26a57f9a89
commit
26e3c92093
1 changed files with 23 additions and 2 deletions
|
@ -1395,10 +1395,31 @@ gst_riff_create_audio_caps (guint16 codec_id,
|
|||
rate_min = 8000;
|
||||
rate_max = 8000;
|
||||
channels_max = 1;
|
||||
caps = gst_caps_new_simple ("audio/x-adpcm",
|
||||
"layout", G_TYPE_STRING, "g726", NULL);
|
||||
if (strf != NULL) {
|
||||
gint bitrate;
|
||||
bitrate = 0;
|
||||
if (strf->av_bps == 2000 || strf->av_bps == 3000 || strf->av_bps == 4000
|
||||
|| strf->av_bps == 5000) {
|
||||
strf->blockalign = strf->av_bps / 1000;
|
||||
bitrate = strf->av_bps * 8;
|
||||
} else if (strf->blockalign >= 2 && strf->blockalign <= 5) {
|
||||
bitrate = strf->blockalign * 8000;
|
||||
}
|
||||
if (bitrate > 0) {
|
||||
caps = gst_caps_new_simple ("audio/x-adpcm",
|
||||
"layout", G_TYPE_STRING, "g726", "bitrate", G_TYPE_INT, bitrate,
|
||||
NULL);
|
||||
} else {
|
||||
caps = gst_caps_new_simple ("audio/x-adpcm",
|
||||
"layout", G_TYPE_STRING, "g726", NULL);
|
||||
}
|
||||
} else {
|
||||
caps = gst_caps_new_simple ("audio/x-adpcm",
|
||||
"layout", G_TYPE_STRING, "g726", NULL);
|
||||
}
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("G726 ADPCM audio");
|
||||
block_align = TRUE;
|
||||
break;
|
||||
|
||||
case GST_RIFF_WAVE_FORMAT_DSP_TRUESPEECH:
|
||||
|
|
Loading…
Reference in a new issue