1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

Update ao_jack for new bio2jack API, improve check in configure.

Patches by Andre Kuehne and Ismail Dönmez.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13013 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2004-08-13 00:33:14 +00:00
parent 77e529d9f7
commit b233aff173
2 changed files with 18 additions and 9 deletions

5
configure vendored
View File

@ -4199,7 +4199,10 @@ cat > $TMPC << EOF
#include <jack/jack.h>
int main(void) { JACK_Init(); return 0; }
EOF
if test -z "$_bio2jackdir" ; then
# This test only checks the minor version number.
if ( ( test ! `bio2jack-config --version | cut -d '.' -f 2` -ge 2 ) ) ; then
_jack=no;
elif test -z "$_bio2jackdir" ; then
cc_check -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
else
cc_check -L "$_bio2jackdir" -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes

View File

@ -34,8 +34,8 @@ void JACK_Reset(int deviceID); /* free all buffered data and reset several value
long JACK_Write(int deviceID, char *data, unsigned long bytes); /* returns the number of bytes written */
long JACK_GetJackLatency(int deviceID); /* return the latency in milliseconds of jack */
int JACK_SetState(int deviceID, enum status_enum state); /* playing, paused, stopped */
int JACK_SetVolume(int deviceID, int left, int right); /* returns 0 on success */
void JACK_GetVolume(int deviceID, int *left, int *right);
int JACK_SetVolumeForChannel(int deviceID, unsigned int channel, unsigned int volume);
void JACK_GetVolumeForChannel(int deviceID, unsigned int channel, unsigned int *volume);
//
@ -57,9 +57,10 @@ static int control(int cmd, void *arg)
case AOCONTROL_GET_VOLUME:
{
ao_control_vol_t *vol = (ao_control_vol_t *)arg;
int l, r;
unsigned int l, r;
JACK_GetVolume(driver, &l, &r);
JACK_GetVolumeForChannel(driver, 0, &l);
JACK_GetVolumeForChannel(driver, 1, &r);
vol->left = (float )l;
vol->right = (float )r;
@ -68,16 +69,21 @@ static int control(int cmd, void *arg)
case AOCONTROL_SET_VOLUME:
{
ao_control_vol_t *vol = (ao_control_vol_t *)arg;
int l = (int )vol->left,
unsigned int l = (int )vol->left,
r = (int )vol->right,
err = 0;
if((err = JACK_SetVolume(driver, l, r))) {
if((err = JACK_SetVolumeForChannel(driver, 0, l))) {
mp_msg(MSGT_AO, MSGL_ERR,
"AO: [Jack] Setting volume failed, error %d\n",err);
"AO: [Jack] Setting left volume failed, error %d\n",err);
return CONTROL_ERROR;
}
if((err = JACK_SetVolumeForChannel(driver, 1, r))) {
mp_msg(MSGT_AO, MSGL_ERR,
"AO: [Jack] Setting right volume failed, error %d\n",err);
return CONTROL_ERROR;
}
return CONTROL_OK;
}
}