mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
modplug: Allow 32 bit depth, modplugs native format.
Fixes bug #605720.
This commit is contained in:
parent
24965dc415
commit
212cf43774
2 changed files with 14 additions and 12 deletions
|
@ -88,7 +88,15 @@ static GstStaticPadTemplate modplug_src_template_factory =
|
||||||
GST_STATIC_PAD_TEMPLATE ("src",
|
GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("audio/x-raw-int,"
|
GST_STATIC_CAPS (
|
||||||
|
"audio/x-raw-int,"
|
||||||
|
" endianness = (int) BYTE_ORDER,"
|
||||||
|
" signed = (boolean) true,"
|
||||||
|
" width = (int) 32,"
|
||||||
|
" depth = (int) 32,"
|
||||||
|
" rate = (int) { 8000, 11025, 22050, 44100 },"
|
||||||
|
" channels = (int) 2; "
|
||||||
|
"audio/x-raw-int,"
|
||||||
" endianness = (int) BYTE_ORDER,"
|
" endianness = (int) BYTE_ORDER,"
|
||||||
" signed = (boolean) true,"
|
" signed = (boolean) true,"
|
||||||
" width = (int) 16,"
|
" width = (int) 16,"
|
||||||
|
@ -248,7 +256,7 @@ gst_modplug_init (GstModPlug * modplug, GstModPlugClass * klass)
|
||||||
modplug->oversamp = DEFAULT_OVERSAMP;
|
modplug->oversamp = DEFAULT_OVERSAMP;
|
||||||
modplug->noise_reduction = DEFAULT_NOISE_REDUCTION;
|
modplug->noise_reduction = DEFAULT_NOISE_REDUCTION;
|
||||||
|
|
||||||
modplug->_16bit = TRUE;
|
modplug->bits = 16;
|
||||||
modplug->channel = 2;
|
modplug->channel = 2;
|
||||||
modplug->frequency = 44100;
|
modplug->frequency = 44100;
|
||||||
}
|
}
|
||||||
|
@ -448,7 +456,6 @@ gst_modplug_load_song (GstModPlug * modplug)
|
||||||
{
|
{
|
||||||
GstCaps *newcaps, *othercaps;
|
GstCaps *newcaps, *othercaps;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gint depth;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (modplug, "Setting caps");
|
GST_DEBUG_OBJECT (modplug, "Setting caps");
|
||||||
|
|
||||||
|
@ -467,23 +474,18 @@ gst_modplug_load_song (GstModPlug * modplug)
|
||||||
|
|
||||||
/* set up modplug to output the negotiated format */
|
/* set up modplug to output the negotiated format */
|
||||||
structure = gst_caps_get_structure (newcaps, 0);
|
structure = gst_caps_get_structure (newcaps, 0);
|
||||||
gst_structure_get_int (structure, "depth", &depth);
|
gst_structure_get_int (structure, "depth", &modplug->bits);
|
||||||
modplug->_16bit = (depth == 16);
|
|
||||||
gst_structure_get_int (structure, "channels", &modplug->channel);
|
gst_structure_get_int (structure, "channels", &modplug->channel);
|
||||||
gst_structure_get_int (structure, "rate", &modplug->frequency);
|
gst_structure_get_int (structure, "rate", &modplug->frequency);
|
||||||
|
|
||||||
modplug->read_samples = 1152;
|
modplug->read_samples = 1152;
|
||||||
modplug->read_bytes = modplug->read_samples * modplug->channel * depth / 8;
|
modplug->read_bytes = modplug->read_samples * modplug->channel * modplug->bits / 8;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (modplug, "Loading song");
|
GST_DEBUG_OBJECT (modplug, "Loading song");
|
||||||
|
|
||||||
modplug->mSoundFile = new CSoundFile;
|
modplug->mSoundFile = new CSoundFile;
|
||||||
|
|
||||||
if (modplug->_16bit)
|
modplug->mSoundFile->SetWaveConfig (modplug->frequency, modplug->bits,
|
||||||
modplug->mSoundFile->SetWaveConfig (modplug->frequency, 16,
|
|
||||||
modplug->channel);
|
|
||||||
else
|
|
||||||
modplug->mSoundFile->SetWaveConfig (modplug->frequency, 8,
|
|
||||||
modplug->channel);
|
modplug->channel);
|
||||||
|
|
||||||
modplug->mSoundFile->SetWaveConfigEx (modplug->surround, !modplug->oversamp,
|
modplug->mSoundFile->SetWaveConfigEx (modplug->surround, !modplug->oversamp,
|
||||||
|
|
|
@ -55,7 +55,7 @@ struct _GstModPlug {
|
||||||
gint surround_depth;
|
gint surround_depth;
|
||||||
gint surround_delay;
|
gint surround_delay;
|
||||||
gboolean noise_reduction;
|
gboolean noise_reduction;
|
||||||
gboolean _16bit;
|
gint bits;
|
||||||
gboolean oversamp;
|
gboolean oversamp;
|
||||||
gint channel;
|
gint channel;
|
||||||
gint frequency;
|
gint frequency;
|
||||||
|
|
Loading…
Reference in a new issue