Mercurial > mplayer.hg
changeset 13424:907cc2547357
With the latest change to dec_audio.c (1.32) the demuxers have to set sh_a->samplesize to something != 0.
author | mosu |
---|---|
date | Tue, 21 Sep 2004 18:02:33 +0000 |
parents | 7f5ea5da1765 |
children | a87f1a948a24 |
files | libmpdemux/demux_mkv.c |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c Tue Sep 21 17:23:49 2004 +0000 +++ b/libmpdemux/demux_mkv.c Tue Sep 21 18:02:33 2004 +0000 @@ -1794,33 +1794,36 @@ sh_a->wf->nChannels = track->a_channels; sh_a->samplerate = (uint32_t) track->a_sfreq; sh_a->wf->nSamplesPerSec = (uint32_t) track->a_sfreq; - sh_a->samplesize = track->a_bps / 8; + if (track->a_bps == 0) + { + sh_a->samplesize = 2; + sh_a->wf->wBitsPerSample = 16; + } + else + { + sh_a->samplesize = track->a_bps / 8; + sh_a->wf->wBitsPerSample = track->a_bps; + } if (track->a_formattag == 0x0055) /* MP3 || MP2 */ { sh_a->wf->nAvgBytesPerSec = 16000; sh_a->wf->nBlockAlign = 1152; - sh_a->wf->wBitsPerSample = 0; - sh_a->samplesize = 0; } else if (!strncmp(track->codec_id, MKV_A_AC3, strlen(MKV_A_AC3))) { sh_a->wf->nAvgBytesPerSec = 16000; sh_a->wf->nBlockAlign = 1536; - sh_a->wf->wBitsPerSample = 0; - sh_a->samplesize = 0; } else if (track->a_formattag == 0x0001) /* PCM || PCM_BE */ { sh_a->wf->nAvgBytesPerSec = sh_a->channels * sh_a->samplerate*2; sh_a->wf->nBlockAlign = sh_a->wf->nAvgBytesPerSec; - sh_a->wf->wBitsPerSample = track->a_bps; if (!strcmp(track->codec_id, MKV_A_PCM_BE)) sh_a->format = mmioFOURCC('t', 'w', 'o', 's'); } else if (!strcmp(track->codec_id, MKV_A_QDMC) || !strcmp(track->codec_id, MKV_A_QDMC2)) { - sh_a->wf->wBitsPerSample = track->a_bps; sh_a->wf->nAvgBytesPerSec = 16000; sh_a->wf->nBlockAlign = 1486; track->fix_i_bps = 1; @@ -1839,8 +1842,6 @@ sh_a->wf->nAvgBytesPerSec = 16000; sh_a->wf->nBlockAlign = 1024; - sh_a->wf->wBitsPerSample = 0; - sh_a->samplesize = 0; /* Recreate the 'private data' */ /* which faad2 uses in its initialization */ @@ -1899,7 +1900,6 @@ ra4p = (real_audio_v4_props_t *) track->private_data; ra5p = (real_audio_v5_props_t *) track->private_data; - sh_a->wf->wBitsPerSample = sh_a->samplesize * 8; sh_a->wf->nAvgBytesPerSec = 0; /* FIXME !? */ sh_a->wf->nBlockAlign = be2me_16 (ra4p->frame_size);