summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-07-16 15:36:20 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-07-16 15:36:20 +0000
commita0cc8bfb13d90d8170e7058ace181b5fb47f19b2 (patch)
tree42e5687a53170e7d39b837f42d9e778c955ee1ac /mplayer.c
parent53ecd003dfa05277790f4510cdf15d9dc18cea61 (diff)
downloadmpv-a0cc8bfb13d90d8170e7058ace181b5fb47f19b2.tar.bz2
mpv-a0cc8bfb13d90d8170e7058ace181b5fb47f19b2.tar.xz
ds->type removed - using id-based audio format detection in mplayer.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1332 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mplayer.c b/mplayer.c
index 433f62249c..15262b5aa9 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -911,11 +911,10 @@ switch(file_format){
has_audio=0;sh_audio=NULL;
} else {
sh_audio=d_audio->sh;sh_audio->ds=d_audio;
- if(verbose) printf("detected MPG-PS audio format: %d\n",d_audio->type);
- switch(d_audio->type){
- case 1: sh_audio->format=0x50;break; // mpeg
- case 2: sh_audio->format=0x10001;break; // dvd pcm
- case 3: sh_audio->format=0x2000;break; // ac3
+ switch(d_audio->id & 0xE0){ // 1110 0000 b (high 3 bit: type low 5: id)
+ case 0x00: sh_audio->format=0x50;break; // mpeg
+ case 0xA0: sh_audio->format=0x10001;break; // dvd pcm
+ case 0x80: sh_audio->format=0x2000;break; // ac3
default: has_audio=0;sh_audio=NULL; // unknown type
}
}