summaryrefslogtreecommitdiff
path: root/ext/modplug
diff options
context:
space:
mode:
authorKaj-Michael Lang <milang@tal.org>2009-12-29 16:07:59 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-01-04 10:18:51 +0100
commit212cf43774565e989ed16350cc83698847e48fcc (patch)
tree9ea93f8656a0fc6edeb17195fe7651eeb8f8c1b9 /ext/modplug
parent24965dc41522578d61c29c61a7788d5d80c8bc12 (diff)
downloadgstreamer-plugins-bad-212cf43774565e989ed16350cc83698847e48fcc.tar.gz
modplug: Allow 32 bit depth, modplugs native format.
Fixes bug #605720.
Diffstat (limited to 'ext/modplug')
-rw-r--r--ext/modplug/gstmodplug.cc24
-rw-r--r--ext/modplug/gstmodplug.h2
2 files changed, 14 insertions, 12 deletions
diff --git a/ext/modplug/gstmodplug.cc b/ext/modplug/gstmodplug.cc
index b928ccd13..9dfe7fc7e 100644
--- a/ext/modplug/gstmodplug.cc
+++ b/ext/modplug/gstmodplug.cc
@@ -88,7 +88,15 @@ static GstStaticPadTemplate modplug_src_template_factory =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
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,"
" signed = (boolean) true,"
" width = (int) 16,"
@@ -248,7 +256,7 @@ gst_modplug_init (GstModPlug * modplug, GstModPlugClass * klass)
modplug->oversamp = DEFAULT_OVERSAMP;
modplug->noise_reduction = DEFAULT_NOISE_REDUCTION;
- modplug->_16bit = TRUE;
+ modplug->bits = 16;
modplug->channel = 2;
modplug->frequency = 44100;
}
@@ -448,7 +456,6 @@ gst_modplug_load_song (GstModPlug * modplug)
{
GstCaps *newcaps, *othercaps;
GstStructure *structure;
- gint depth;
GST_DEBUG_OBJECT (modplug, "Setting caps");
@@ -467,23 +474,18 @@ gst_modplug_load_song (GstModPlug * modplug)
/* set up modplug to output the negotiated format */
structure = gst_caps_get_structure (newcaps, 0);
- gst_structure_get_int (structure, "depth", &depth);
- modplug->_16bit = (depth == 16);
+ gst_structure_get_int (structure, "depth", &modplug->bits);
gst_structure_get_int (structure, "channels", &modplug->channel);
gst_structure_get_int (structure, "rate", &modplug->frequency);
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");
modplug->mSoundFile = new CSoundFile;
- if (modplug->_16bit)
- modplug->mSoundFile->SetWaveConfig (modplug->frequency, 16,
- modplug->channel);
- else
- modplug->mSoundFile->SetWaveConfig (modplug->frequency, 8,
+ modplug->mSoundFile->SetWaveConfig (modplug->frequency, modplug->bits,
modplug->channel);
modplug->mSoundFile->SetWaveConfigEx (modplug->surround, !modplug->oversamp,
diff --git a/ext/modplug/gstmodplug.h b/ext/modplug/gstmodplug.h
index b08af2409..0c02eb2ff 100644
--- a/ext/modplug/gstmodplug.h
+++ b/ext/modplug/gstmodplug.h
@@ -55,7 +55,7 @@ struct _GstModPlug {
gint surround_depth;
gint surround_delay;
gboolean noise_reduction;
- gboolean _16bit;
+ gint bits;
gboolean oversamp;
gint channel;
gint frequency;