mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-16 13:26:36 +00:00
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.
This commit is contained in:
parent
9518c22bda
commit
76b2b0502d
2 changed files with 21 additions and 15 deletions
|
@ -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:
|
||||
|
|
|
@ -79,19 +79,8 @@ 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,
|
||||
|
@ -100,6 +89,16 @@ static const long bitrates[2][3][16] = {
|
|||
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) +
|
||||
|
|
Loading…
Reference in a new issue