summaryrefslogtreecommitdiffstats
path: root/sys/dshowdecwrapper
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dshowdecwrapper')
-rw-r--r--sys/dshowdecwrapper/gstdshowaudiodec.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/dshowdecwrapper/gstdshowaudiodec.c b/sys/dshowdecwrapper/gstdshowaudiodec.c
index e436beb8..574ce1c6 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) +