comparison libao2/pl_extrastereo.c @ 8739:66f3204117d6

trivial bigendian fix
author colin
date Fri, 03 Jan 2003 14:49:02 +0000
parents 776b686069af
children 46d21c0f36aa
comparison
equal deleted inserted replaced
8738:a9170a2ab0a4 8739:66f3204117d6
1 /* Extrastereo effect plugin 1 /* Extrastereo effect plugin
2 * (linearly increases difference between L&R channels) 2 * (linearly increases difference between L&R channels)
3 * 3 *
4 * Current limitations: 4 * Current limitations:
5 * - only AFMT_S16_LE is supported currently 5 * - only AFMT_S16_HE is supported currently
6 * 6 *
7 * License: GPLv2 (as a mix of pl_volume.c and 7 * License: GPLv2 (as a mix of pl_volume.c and
8 * xmms:stereo_plugin/stereo.c) 8 * xmms:stereo_plugin/stereo.c)
9 * 9 *
10 * Author: pl <p_l@gmx.fr> (c) 2002 and beyond... 10 * Author: pl <p_l@gmx.fr> (c) 2002 and beyond...
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"
23 24
24 static ao_info_t info = { 25 static ao_info_t info = {
25 "Extra stereo plugin", 26 "Extra stereo plugin",
26 "extrastereo", 27 "extrastereo",
27 "pl <p_l@gmx.fr>", 28 "pl <p_l@gmx.fr>",
55 56
56 // open & setup audio device 57 // open & setup audio device
57 // return: 1=success 0=fail 58 // return: 1=success 0=fail
58 static int init(){ 59 static int init(){
59 switch(ao_plugin_data.format){ 60 switch(ao_plugin_data.format){
61 #ifndef WORDS_BIGENDIAN
60 case(AFMT_S16_LE): 62 case(AFMT_S16_LE):
63 #else
64 case(AFMT_S16_BE):
65 #endif
61 break; 66 break;
62 default: 67 default:
63 fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n"); 68 fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n");
64 return 0; 69 return 0;
65 } 70 }
85 // processes 'ao_plugin_data.len' bytes of 'data' 90 // processes 'ao_plugin_data.len' bytes of 'data'
86 // called for every block of data 91 // called for every block of data
87 static int play(){ 92 static int play(){
88 93
89 switch(pl_extrastereo.format){ 94 switch(pl_extrastereo.format){
95 #ifndef WORDS_BIGENDIAN
90 case(AFMT_S16_LE): { 96 case(AFMT_S16_LE): {
97 #else
98 case(AFMT_S16_BE): {
99 #endif
91 100
92 int16_t* data=(int16_t*)ao_plugin_data.data; 101 int16_t* data=(int16_t*)ao_plugin_data.data;
93 int len=ao_plugin_data.len / 2; // 16 bits samples 102 int len=ao_plugin_data.len / 2; // 16 bits samples
94 103
95 float mul = pl_extrastereo.mul; 104 float mul = pl_extrastereo.mul;