Mercurial > mplayer.hg
comparison libao2/pl_extrastereo.c @ 8741:46d21c0f36aa
(nicer) endianness fix for every plugin except pl_format
author | colin |
---|---|
date | Fri, 03 Jan 2003 15:12:18 +0000 |
parents | 66f3204117d6 |
children | 12b1790038b0 |
comparison
equal
deleted
inserted
replaced
8740:cd67631ae382 | 8741:46d21c0f36aa |
---|---|
18 | 18 |
19 #include "audio_out.h" | 19 #include "audio_out.h" |
20 #include "audio_plugin.h" | 20 #include "audio_plugin.h" |
21 #include "audio_plugin_internal.h" | 21 #include "audio_plugin_internal.h" |
22 #include "afmt.h" | 22 #include "afmt.h" |
23 #include "../config.h" | |
24 | 23 |
25 static ao_info_t info = { | 24 static ao_info_t info = { |
26 "Extra stereo plugin", | 25 "Extra stereo plugin", |
27 "extrastereo", | 26 "extrastereo", |
28 "pl <p_l@gmx.fr>", | 27 "pl <p_l@gmx.fr>", |
56 | 55 |
57 // open & setup audio device | 56 // open & setup audio device |
58 // return: 1=success 0=fail | 57 // return: 1=success 0=fail |
59 static int init(){ | 58 static int init(){ |
60 switch(ao_plugin_data.format){ | 59 switch(ao_plugin_data.format){ |
61 #ifndef WORDS_BIGENDIAN | 60 case(AFMT_S16_NE): |
62 case(AFMT_S16_LE): | |
63 #else | |
64 case(AFMT_S16_BE): | |
65 #endif | |
66 break; | 61 break; |
67 default: | 62 default: |
68 fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n"); | 63 fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n"); |
69 return 0; | 64 return 0; |
70 } | 65 } |
90 // processes 'ao_plugin_data.len' bytes of 'data' | 85 // processes 'ao_plugin_data.len' bytes of 'data' |
91 // called for every block of data | 86 // called for every block of data |
92 static int play(){ | 87 static int play(){ |
93 | 88 |
94 switch(pl_extrastereo.format){ | 89 switch(pl_extrastereo.format){ |
95 #ifndef WORDS_BIGENDIAN | 90 case(AFMT_S16_NE): { |
96 case(AFMT_S16_LE): { | |
97 #else | |
98 case(AFMT_S16_BE): { | |
99 #endif | |
100 | 91 |
101 int16_t* data=(int16_t*)ao_plugin_data.data; | 92 int16_t* data=(int16_t*)ao_plugin_data.data; |
102 int len=ao_plugin_data.len / 2; // 16 bits samples | 93 int len=ao_plugin_data.len / 2; // 16 bits samples |
103 | 94 |
104 float mul = pl_extrastereo.mul; | 95 float mul = pl_extrastereo.mul; |