Make sure that samplesize is at least 2, as some demuxers set it to 1

(demux_ogg for ac3 in ogm) or possibly even 0, and it causes preinit
to set audio_out_minsize too low, which causes overflow (assert).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15560 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
hzoli 2005-05-24 06:54:19 +00:00
parent e06d2ac7ac
commit 813668889d
1 changed files with 1 additions and 0 deletions

View File

@ -126,6 +126,7 @@ static int preinit(sh_audio_t *sh)
{
/* Dolby AC3 audio: */
/* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */
if (sh->samplesize < 2) sh->samplesize = 2;
sh->audio_out_minsize=audio_output_channels*sh->samplesize*256*6;
sh->audio_in_minsize=3840;
a52_level = 1.0;