fix audio init crash

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15581 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
joey 2005-05-28 20:12:09 +00:00
parent 9c135cb804
commit ad29da9c9b
1 changed files with 11 additions and 1 deletions

View File

@ -635,7 +635,17 @@ int demux_ty_fill_buffer( demuxer_t *demux )
if( demux->audio->id == aid )
{
ds = demux->audio;
if( !ds->sh ) ds->sh = demux->a_streams[ aid ];
if( !ds->sh ) {
sh_audio_t* sh_a;
ds->sh = demux->a_streams[ aid ];
sh_a = (sh_audio_t*)ds->sh;
switch(aid & 0xE0){ // 1110 0000 b (high 3 bit: type low 5: id)
case 0x00: sh_a->format=0x50;break; // mpeg
case 0xA0: sh_a->format=0x10001;break; // dvd pcm
case 0x80: if((aid & 0xF8) == 0x88) sh_a->format=0x2001;//dts
else sh_a->format=0x2000;break; // ac3
}
}
}
}