annotate libmpcodecs/ad_dvdpcm.c @ 36816:790318d7ce23

Don't automatically apply the Win32 GUI preferences' defaults. Just present them and let the user decide whether to apply or to cancel.
author ib
date Sun, 23 Feb 2014 19:35:08 +0000
parents e648bb154916
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30421
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
1 /*
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
2 * This file is part of MPlayer.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
3 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
5 * it under the terms of the GNU General Public License as published by
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
7 * (at your option) any later version.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
8 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
12 * GNU General Public License for more details.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
13 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
14 * You should have received a copy of the GNU General Public License along
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
17 */
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
18
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
19 #include <stdio.h>
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
20 #include <stdlib.h>
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
21 #include <unistd.h>
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
22
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
23 #include "config.h"
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
24 #include "mp_msg.h"
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
25 #include "help_mp.h"
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
26 #include "ad_internal.h"
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
27
30504
cc27da5d7286 Mark all ad_info_t/vd_info_t structure declarations as const.
diego
parents: 30421
diff changeset
28 static const ad_info_t info =
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
29 {
7191
1eadce15446c -afm/-vfm help implemenetd, some cosmetics of ad/vd codec names/comments
arpi
parents: 7180
diff changeset
30 "Uncompressed DVD/VOB LPCM audio decoder",
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
31 "dvdpcm",
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
32 "Nick Kurshev",
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
33 "A'rpi",
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
34 ""
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
35 };
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
36
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
37 LIBAD_EXTERN(dvdpcm)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
38
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
39 static int init(sh_audio_t *sh)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
40 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
41 /* DVD PCM Audio:*/
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
42 sh->i_bps = 0;
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
43 if(sh->codecdata_len==3){
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
44 // we have LPCM header:
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
45 unsigned char h=sh->codecdata[1];
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
46 sh->channels=1+(h&7);
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
47 switch((h>>4)&3){
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
48 case 0: sh->samplerate=48000;break;
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
49 case 1: sh->samplerate=96000;break;
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
50 case 2: sh->samplerate=44100;break;
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
51 case 3: sh->samplerate=32000;break;
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
52 }
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
53 switch ((h >> 6) & 3) {
36640
e648bb154916 ad_dvdpcm: simplify/clarify code.
reimar
parents: 30504
diff changeset
54 default:
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
55 case 0:
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
56 sh->sample_format = AF_FORMAT_S16_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
57 sh->samplesize = 2;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
58 break;
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
59 case 1:
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
60 mp_msg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_SamplesWanted);
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
61 sh->i_bps = sh->channels * sh->samplerate * 5 / 2;
36640
e648bb154916 ad_dvdpcm: simplify/clarify code.
reimar
parents: 30504
diff changeset
62 /* Fallthrough, 20 bit will be output as 24 bit */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 14245
diff changeset
63 case 2:
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
64 sh->sample_format = AF_FORMAT_S24_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
65 sh->samplesize = 3;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
66 break;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
67 }
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
68 } else {
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
69 // use defaults:
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
70 sh->channels=2;
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
71 sh->samplerate=48000;
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
72 sh->sample_format = AF_FORMAT_S16_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
73 sh->samplesize = 2;
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
74 }
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
75 if (!sh->i_bps)
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
76 sh->i_bps = sh->samplesize * sh->channels * sh->samplerate;
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
77 return 1;
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
78 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
79
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
80 static int preinit(sh_audio_t *sh)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
81 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
82 sh->audio_out_minsize=2048;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
83 return 1;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
84 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
85
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
86 static void uninit(sh_audio_t *sh)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
87 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
88 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
89
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
90 static int control(sh_audio_t *sh,int cmd,void* arg, ...)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
91 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
92 int skip;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
93 switch(cmd)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
94 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
95 case ADCTRL_SKIP_FRAME:
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
96 skip=sh->i_bps/16;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
97 skip=skip&(~3);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
98 demux_read_data(sh->ds,NULL,skip);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
99 return CONTROL_TRUE;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
100 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
101 return CONTROL_UNKNOWN;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
102 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
103
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
104 static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
105 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
106 int j,len;
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
107 if (sh_audio->samplesize == 3) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
108 if (((sh_audio->codecdata[1] >> 6) & 3) == 1) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
109 // 20 bit
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
110 // not sure if the "& 0xf0" and "<< 4" are the right way around
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
111 // can somebody clarify?
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
112 for (j = 0; j < minlen; j += 12) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
113 char tmp[10];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
114 len = demux_read_data(sh_audio->ds, tmp, 10);
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
115 if (len < 10) break;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
116 // first sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
117 buf[j + 0] = tmp[0];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
118 buf[j + 1] = tmp[1];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
119 buf[j + 2] = tmp[8] & 0xf0;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
120 // second sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
121 buf[j + 3] = tmp[2];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
122 buf[j + 4] = tmp[3];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
123 buf[j + 5] = tmp[8] << 4;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
124 // third sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
125 buf[j + 6] = tmp[4];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
126 buf[j + 7] = tmp[5];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
127 buf[j + 8] = tmp[9] & 0xf0;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
128 // fourth sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
129 buf[j + 9] = tmp[6];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
130 buf[j + 10] = tmp[7];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
131 buf[j + 11] = tmp[9] << 4;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
132 }
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
133 len = j;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
134 } else {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
135 // 24 bit
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
136 for (j = 0; j < minlen; j += 12) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
137 char tmp[12];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
138 len = demux_read_data(sh_audio->ds, tmp, 12);
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
139 if (len < 12) break;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
140 // first sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
141 buf[j + 0] = tmp[0];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
142 buf[j + 1] = tmp[1];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
143 buf[j + 2] = tmp[8];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
144 // second sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
145 buf[j + 3] = tmp[2];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
146 buf[j + 4] = tmp[3];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
147 buf[j + 5] = tmp[9];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
148 // third sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
149 buf[j + 6] = tmp[4];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
150 buf[j + 7] = tmp[5];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
151 buf[j + 8] = tmp[10];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
152 // fourth sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
153 buf[j + 9] = tmp[6];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
154 buf[j + 10] = tmp[7];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
155 buf[j + 11] = tmp[11];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
156 }
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
157 len = j;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
158 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 14245
diff changeset
159 } else
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
160 len=demux_read_data(sh_audio->ds,buf,(minlen+3)&(~3));
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
161 return len;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
162 }