Mercurial > mplayer.hg
annotate libmpcodecs/ad_pcm.c @ 30903:565f6d0f0d2a
Make all instances of codec_patch unconditional, otherwise
compilation will break on systems that do not have win32 dlls
enabled. Fixes compilation bug introduced by r30942
10l to the anonymous guy who explains the importance of commit messages
and would like to have romance novels in these very messages.
author | attila |
---|---|
date | Sun, 21 Mar 2010 10:13:00 +0000 |
parents | cc27da5d7286 |
children | b50bb3e564d6 |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
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:
30386
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:
30386
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:
30386
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
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:
30386
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:
30386
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:
30386
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
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:
30386
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:
30386
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:
30386
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
30386
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" |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
24 #include "ad_internal.h" |
17012 | 25 #include "libaf/af_format.h" |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
26 #include "libaf/reorder_ch.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
|
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 { |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
30 "Uncompressed PCM audio decoder", |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
31 "pcm", |
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(pcm) |
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_audio) |
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 WAVEFORMATEX *h=sh_audio->wf; |
30386
d33d65802937
Fail ad_pcm initialization of WAVEFORMATEX header is missing instead of crashing.
reimar
parents:
29263
diff
changeset
|
42 if (!h) |
d33d65802937
Fail ad_pcm initialization of WAVEFORMATEX header is missing instead of crashing.
reimar
parents:
29263
diff
changeset
|
43 return 0; |
5340
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
44 sh_audio->i_bps=h->nAvgBytesPerSec; |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
45 sh_audio->channels=h->nChannels; |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
46 sh_audio->samplerate=h->nSamplesPerSec; |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
47 sh_audio->samplesize=(h->wBitsPerSample+7)/8; |
14245 | 48 sh_audio->sample_format=AF_FORMAT_S16_LE; // default |
5340
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
49 switch(sh_audio->format){ /* hardware formats: */ |
12539 | 50 case 0x0: |
12447
fde132f084ce
fix bigendian problems (left-right swapped 8bit pcms), add 32bit support
reimar
parents:
12080
diff
changeset
|
51 case 0x1: // Microsoft PCM |
14833
78385a72a8bb
Add support for 32-bit float WAV files and support for extended WAV files
ivo
parents:
14245
diff
changeset
|
52 case 0xfffe: // Extended |
12447
fde132f084ce
fix bigendian problems (left-right swapped 8bit pcms), add 32bit support
reimar
parents:
12080
diff
changeset
|
53 switch (sh_audio->samplesize) { |
14245 | 54 case 1: sh_audio->sample_format=AF_FORMAT_U8; break; |
55 case 2: sh_audio->sample_format=AF_FORMAT_S16_LE; break; | |
56 case 3: sh_audio->sample_format=AF_FORMAT_S24_LE; break; | |
57 case 4: sh_audio->sample_format=AF_FORMAT_S32_LE; break; | |
12447
fde132f084ce
fix bigendian problems (left-right swapped 8bit pcms), add 32bit support
reimar
parents:
12080
diff
changeset
|
58 } |
fde132f084ce
fix bigendian problems (left-right swapped 8bit pcms), add 32bit support
reimar
parents:
12080
diff
changeset
|
59 break; |
14833
78385a72a8bb
Add support for 32-bit float WAV files and support for extended WAV files
ivo
parents:
14245
diff
changeset
|
60 case 0x3: // IEEE float |
78385a72a8bb
Add support for 32-bit float WAV files and support for extended WAV files
ivo
parents:
14245
diff
changeset
|
61 sh_audio->sample_format=AF_FORMAT_FLOAT_LE; |
78385a72a8bb
Add support for 32-bit float WAV files and support for extended WAV files
ivo
parents:
14245
diff
changeset
|
62 break; |
14245 | 63 case 0x6: sh_audio->sample_format=AF_FORMAT_A_LAW;break; |
64 case 0x7: sh_audio->sample_format=AF_FORMAT_MU_LAW;break; | |
65 case 0x11: sh_audio->sample_format=AF_FORMAT_IMA_ADPCM;break; | |
66 case 0x50: sh_audio->sample_format=AF_FORMAT_MPEG2;break; | |
5340
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
67 /* case 0x2000: sh_audio->sample_format=AFMT_AC3; */ |
12498 | 68 case 0x20776172: // 'raw ' |
14245 | 69 sh_audio->sample_format=AF_FORMAT_S16_BE; |
70 if(sh_audio->samplesize==1) sh_audio->sample_format=AF_FORMAT_U8; | |
12498 | 71 break; |
8102 | 72 case 0x736F7774: // 'twos' |
14245 | 73 sh_audio->sample_format=AF_FORMAT_S16_BE; |
12447
fde132f084ce
fix bigendian problems (left-right swapped 8bit pcms), add 32bit support
reimar
parents:
12080
diff
changeset
|
74 // intended fall-through |
20704
666efb20e7d5
Fix comment, it's 'sowt', not 'swot' ('twos' reversed)
reimar
parents:
19383
diff
changeset
|
75 case 0x74776F73: // 'sowt' |
14245 | 76 if(sh_audio->samplesize==1) sh_audio->sample_format=AF_FORMAT_S8; |
6233 | 77 break; |
14055 | 78 case 0x32336c66: // 'fl32', bigendian float32 |
14245 | 79 sh_audio->sample_format=AF_FORMAT_FLOAT_BE; |
14055 | 80 sh_audio->samplesize=4; |
81 break; | |
17858
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
82 case 0x666c3332: // '23lf', little endian float32, MPlayer internal fourCC |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
83 sh_audio->sample_format=AF_FORMAT_FLOAT_LE; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
84 sh_audio->samplesize=4; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
85 break; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
86 /* case 0x34366c66: // 'fl64', bigendian float64 |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
87 sh_audio->sample_format=AF_FORMAT_FLOAT_BE; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
88 sh_audio->samplesize=8; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
89 break; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
90 case 0x666c3634: // '46lf', little endian float64, MPlayer internal fourCC |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
91 sh_audio->sample_format=AF_FORMAT_FLOAT_LE; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
92 sh_audio->samplesize=8; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
93 break;*/ |
17813 | 94 case 0x34326e69: // 'in24', bigendian int24 |
95 sh_audio->sample_format=AF_FORMAT_S24_BE; | |
96 sh_audio->samplesize=3; | |
97 break; | |
17858
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
98 case 0x696e3234: // '42ni', little endian int24, MPlayer internal fourCC |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
99 sh_audio->sample_format=AF_FORMAT_S24_LE; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
100 sh_audio->samplesize=3; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
101 break; |
17813 | 102 case 0x32336e69: // 'in32', bigendian int32 |
103 sh_audio->sample_format=AF_FORMAT_S32_BE; | |
104 sh_audio->samplesize=4; | |
105 break; | |
17858
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
106 case 0x696e3332: // '23ni', little endian int32, MPlayer internal fourCC |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
107 sh_audio->sample_format=AF_FORMAT_S32_LE; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
108 sh_audio->samplesize=4; |
996e419c1671
in24/in32/fl32 little/big-endian QuickTime PCM audio support
rathann
parents:
17813
diff
changeset
|
109 break; |
14245 | 110 default: if(sh_audio->samplesize!=2) sh_audio->sample_format=AF_FORMAT_U8; |
5340
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
111 } |
16134
a1fd1a7eeb35
lavf demuxer with raw PCM fix (and a related hang)
reimar
parents:
14833
diff
changeset
|
112 if (!sh_audio->samplesize) // this would cause MPlayer to hang later |
a1fd1a7eeb35
lavf demuxer with raw PCM fix (and a related hang)
reimar
parents:
14833
diff
changeset
|
113 sh_audio->samplesize = 2; |
5340
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
114 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
|
115 } |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
116 |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
117 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
|
118 { |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
119 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
|
120 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
|
121 } |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
122 |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
123 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
|
124 { |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
125 } |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
126 |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
127 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
|
128 { |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
129 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
|
130 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
|
131 { |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
132 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 } |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
138 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
|
139 } |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
140 |
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
141 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
|
142 { |
16307 | 143 unsigned len = sh_audio->channels*sh_audio->samplesize; |
19383
0a6382b5b6ee
Change pcm decode_audio to return data based on minlen instead of maxlen
uau
parents:
17868
diff
changeset
|
144 len = (minlen + len - 1) / len * len; |
0a6382b5b6ee
Change pcm decode_audio to return data based on minlen instead of maxlen
uau
parents:
17868
diff
changeset
|
145 if (len > maxlen) |
0a6382b5b6ee
Change pcm decode_audio to return data based on minlen instead of maxlen
uau
parents:
17868
diff
changeset
|
146 // if someone needs hundreds of channels adjust audio_out_minsize |
0a6382b5b6ee
Change pcm decode_audio to return data based on minlen instead of maxlen
uau
parents:
17868
diff
changeset
|
147 // based on channels in preinit() |
0a6382b5b6ee
Change pcm decode_audio to return data based on minlen instead of maxlen
uau
parents:
17868
diff
changeset
|
148 return -1; |
5455 | 149 len=demux_read_data(sh_audio->ds,buf,len); |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
150 if (len > 0 && sh_audio->channels >= 5) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
151 reorder_channel_nch(buf, AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
152 AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
153 sh_audio->channels, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
154 len / sh_audio->samplesize, sh_audio->samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
20704
diff
changeset
|
155 } |
5455 | 156 return len; |
5340
0f12fb7c1c5d
imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff
changeset
|
157 } |