int channels;
int frame_size; /* in bytes ! */
int codec_id;
+ int flip_left : 1;
UINT8 buffer[AUDIO_BLOCK_SIZE];
int buffer_ptr;
} AudioData;
{
int audio_fd;
int tmp, err;
+ char *flip = getenv("AUDIO_FLIP_LEFT");
/* open linux audio device */
if (is_output)
return -EIO;
}
+ if (flip && *flip == '1') {
+ s->flip_left = 1;
+ }
+
/* non blocking mode */
fcntl(audio_fd, F_SETFL, O_NONBLOCK);
perror("SNDCTL_DSP_STEREO");
goto fail;
}
+ if (tmp)
+ s->channels = 2;
tmp = s->sample_rate;
err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp);
}
}
pkt->size = ret;
+ if (s->flip_left && s->channels == 2) {
+ int i;
+ short *p = (short *) pkt->data;
+
+ for (i = 0; i < ret; i += 4) {
+ *p = ~*p;
+ p += 2;
+ }
+ }
return 0;
}