diff options
author | Michael Smith <msmith@xiph.org> | 2008-08-23 00:01:39 +0000 |
---|---|---|
committer | Michael Smith <msmith@xiph.org> | 2008-08-23 00:01:39 +0000 |
commit | 76b2b0502d785edc9040d48306639342a3d01963 (patch) | |
tree | e599840f33cdb2357ff4a2898387401c903d87f0 /sys/dshowdecwrapper | |
parent | 9518c22bda7325964c8963eb36109809861bfdaa (diff) | |
download | gst-plugins-bad-76b2b0502d785edc9040d48306639342a3d01963.tar.gz gst-plugins-bad-76b2b0502d785edc9040d48306639342a3d01963.tar.bz2 gst-plugins-bad-76b2b0502d785edc9040d48306639342a3d01963.zip |
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.
Diffstat (limited to 'sys/dshowdecwrapper')
-rw-r--r-- | sys/dshowdecwrapper/gstdshowaudiodec.c | 29 |
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) + |