annotate libmpcodecs/ad_dvdpcm.c @ 32617:1baaacf00bbb

Improve speex codec pts handling, make audio timestamps work reasonably even with the native demuxer as long as seeking is not done.
author reimar
date Sun, 12 Dec 2010 12:36:56 +0000
parents cc27da5d7286
children e648bb154916
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) {
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
54 case 0:
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
55 sh->sample_format = AF_FORMAT_S16_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
56 sh->samplesize = 2;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
57 break;
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
58 case 1:
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
59 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
60 sh->i_bps = sh->channels * sh->samplerate * 5 / 2;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 14245
diff changeset
61 case 2:
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
62 sh->sample_format = AF_FORMAT_S24_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
63 sh->samplesize = 3;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
64 break;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
65 default:
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
66 sh->sample_format = AF_FORMAT_S16_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
67 sh->samplesize = 2;
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
68 }
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
69 } else {
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
70 // use defaults:
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
71 sh->channels=2;
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
72 sh->samplerate=48000;
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13980
diff changeset
73 sh->sample_format = AF_FORMAT_S16_BE;
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
74 sh->samplesize = 2;
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
75 }
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
76 if (!sh->i_bps)
13236
97a6f049c9f8 first attempt to make 24-bit PCM DVDs work
reimar
parents: 7670
diff changeset
77 sh->i_bps = sh->samplesize * sh->channels * sh->samplerate;
7670
d388a7ee48c5 parse samplerate & channels from LPCM header
arpi
parents: 7191
diff changeset
78 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
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
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
81 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
82 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
83 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
84 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
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
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
87 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
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
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
91 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
92 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
93 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
94 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
95 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
96 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
97 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
98 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
99 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
100 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
101 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
102 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
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
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
105 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
106 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
107 int j,len;
13595
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
108 if (sh_audio->samplesize == 3) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
109 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
110 // 20 bit
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
111 // 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
112 // can somebody clarify?
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
113 for (j = 0; j < minlen; j += 12) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
114 char tmp[10];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
115 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
116 if (len < 10) break;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
117 // first sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
118 buf[j + 0] = tmp[0];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
119 buf[j + 1] = tmp[1];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
120 buf[j + 2] = tmp[8] & 0xf0;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
121 // second sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
122 buf[j + 3] = tmp[2];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
123 buf[j + 4] = tmp[3];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
124 buf[j + 5] = tmp[8] << 4;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
125 // third sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
126 buf[j + 6] = tmp[4];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
127 buf[j + 7] = tmp[5];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
128 buf[j + 8] = tmp[9] & 0xf0;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
129 // fourth sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
130 buf[j + 9] = tmp[6];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
131 buf[j + 10] = tmp[7];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
132 buf[j + 11] = tmp[9] << 4;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
133 }
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
134 len = j;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
135 } else {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
136 // 24 bit
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
137 for (j = 0; j < minlen; j += 12) {
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
138 char tmp[12];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
139 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
140 if (len < 12) break;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
141 // first sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
142 buf[j + 0] = tmp[0];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
143 buf[j + 1] = tmp[1];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
144 buf[j + 2] = tmp[8];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
145 // second sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
146 buf[j + 3] = tmp[2];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
147 buf[j + 4] = tmp[3];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
148 buf[j + 5] = tmp[9];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
149 // third sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
150 buf[j + 6] = tmp[4];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
151 buf[j + 7] = tmp[5];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
152 buf[j + 8] = tmp[10];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
153 // fourth sample
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
154 buf[j + 9] = tmp[6];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
155 buf[j + 10] = tmp[7];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
156 buf[j + 11] = tmp[11];
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
157 }
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
158 len = j;
f67d20c01332 Support for 24 bit and 20 bit LPCM (simple and slow :-( )
reimar
parents: 13236
diff changeset
159 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 14245
diff changeset
160 } 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
161 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
162 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
163 }