summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-08-23 00:01:39 +0000
committerMichael Smith <msmith@xiph.org>2008-08-23 00:01:39 +0000
commit76b2b0502d785edc9040d48306639342a3d01963 (patch)
treee599840f33cdb2357ff4a2898387401c903d87f0
parent9518c22bda7325964c8963eb36109809861bfdaa (diff)
sys/dshowdecwrapper/gstdshowaudiodec.c: Flip mpeg1/mpeg2 arrays for mpeg audio. Detect which type the audio is correc...
Original commit message from CVS: * sys/dshowdecwrapper/gstdshowaudiodec.c: Flip mpeg1/mpeg2 arrays for mpeg audio. Detect which type the audio is correctly, instead of backwards. No functional changes, since this mistake was completely self-consistent.
-rw-r--r--ChangeLog7
-rw-r--r--sys/dshowdecwrapper/gstdshowaudiodec.c29
2 files changed, 21 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index f7e6255bd..feedc579b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-22 Michael Smith <msmith@songbirdnest.com>
+
+ * sys/dshowdecwrapper/gstdshowaudiodec.c:
+ Flip mpeg1/mpeg2 arrays for mpeg audio. Detect which type the audio
+ is correctly, instead of backwards. No functional changes, since this
+ mistake was completely self-consistent.
+
2008-08-22 Stefan Kost <ensonic@users.sf.net>
* docs/plugins/gst-plugins-bad-plugins-docs.sgml:
diff --git a/sys/dshowdecwrapper/gstdshowaudiodec.c b/sys/dshowdecwrapper/gstdshowaudiodec.c
index e436beb8c..574ce1c65 100644
--- a/sys/dshowdecwrapper/gstdshowaudiodec.c
+++ b/sys/dshowdecwrapper/gstdshowaudiodec.c
@@ -79,27 +79,26 @@ static gboolean gst_dshowaudiodec_flush (GstDshowAudioDec * adec);
static gboolean gst_dshowaudiodec_get_filter_settings (GstDshowAudioDec * adec);
static gboolean gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec);
-/* global variable */
-static const long bitrates[2][3][16] = {
+static const long mpeg_bitrates[2][3][16] = {
/* mpeg 1 */
{
/* one list per layer 1-3 */
- {0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000,
- 160000, 176000, 192000, 224000, 256000, 0},
- {0, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000,
- 112000, 128000, 144000, 160000, 0},
- {0, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000,
- 112000, 128000, 144000, 160000, 0},
- },
- /* mpeg 2 */
- {
- /* one list per layer 1-3 */
{0, 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000,
288000, 320000, 352000, 384000, 416000, 448000, 0},
{0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000,
160000, 192000, 224000, 256000, 320000, 384000, 0},
{0, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000,
128000, 160000, 192000, 224000, 256000, 320000, 0},
+ },
+ /* mpeg 2 */
+ {
+ /* one list per layer 1-3 */
+ {0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000,
+ 160000, 176000, 192000, 224000, 256000, 0},
+ {0, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000,
+ 112000, 128000, 144000, 160000, 0},
+ {0, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000,
+ 112000, 128000, 144000, 160000, 0},
}
};
@@ -746,11 +745,11 @@ gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec)
break;
};
- version = (b1 >> 3) & 1;
+ version = ((b1 >> 3) & 1) ? 0 : 1;
if (layer == 1) {
samples = 384;
} else {
- if (version == 0) {
+ if (version == 1) {
samples = 576;
} else {
samples = 1152;
@@ -758,7 +757,7 @@ gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec)
}
mpeg1_format->wfx.nBlockAlign = (WORD) samples;
mpeg1_format->wfx.nSamplesPerSec = adec->rate;
- mpeg1_format->dwHeadBitrate = bitrates[version][layer - 1][b2 >> 4];
+ mpeg1_format->dwHeadBitrate = mpeg_bitrates[version][layer - 1][b2 >> 4];
mpeg1_format->wfx.nAvgBytesPerSec = mpeg1_format->dwHeadBitrate / 8;
} else {
size = sizeof (WAVEFORMATEX) +