summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-10-25 05:12:34 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-10-25 05:12:34 +0300
commit030130942562bb7b84eeba53e0226abed5a63a4c (patch)
tree9b49208facf2801369c9d2d7b3e7af11fab36829 /libao2
parent562d86d95cbba67cb58358f6fc334553a467dee7 (diff)
parent15a80092161a1cd305f8005c780c744416a5252b (diff)
downloadmpv-030130942562bb7b84eeba53e0226abed5a63a4c.tar.bz2
mpv-030130942562bb7b84eeba53e0226abed5a63a4c.tar.xz
Merge svn changes up to 27824
Conflicts: cfg-common-opts.h libmpcodecs/dec_video.c libmpcodecs/vd.c libvo/x11_common.h mplayer.c stream/cache2.c
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_alsa.c14
-rw-r--r--libao2/ao_sdl.c2
2 files changed, 10 insertions, 6 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c
index 987713e6f9..cd7b862728 100644
--- a/libao2/ao_alsa.c
+++ b/libao2/ao_alsa.c
@@ -192,7 +192,7 @@ static int control(int cmd, void *arg)
set_vol = vol->left / f_multi + pmin + 0.5;
//setting channels
- if ((err = snd_mixer_selem_set_playback_volume(elem, 0, set_vol)) < 0) {
+ if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingLeftChannel,
snd_strerror(err));
return CONTROL_ERROR;
@@ -201,7 +201,7 @@ static int control(int cmd, void *arg)
set_vol = vol->right / f_multi + pmin + 0.5;
- if ((err = snd_mixer_selem_set_playback_volume(elem, 1, set_vol)) < 0) {
+ if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, set_vol)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingRightChannel,
snd_strerror(err));
return CONTROL_ERROR;
@@ -221,9 +221,9 @@ static int control(int cmd, void *arg)
}
}
else {
- snd_mixer_selem_get_playback_volume(elem, 0, &get_vol);
+ snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, &get_vol);
vol->left = (get_vol - pmin) * f_multi;
- snd_mixer_selem_get_playback_volume(elem, 1, &get_vol);
+ snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, &get_vol);
vol->right = (get_vol - pmin) * f_multi;
mp_msg(MSGT_AO,MSGL_DBG2,"left=%f, right=%f\n",vol->left,vol->right);
@@ -707,7 +707,7 @@ static int init(int rate_hz, int channels, int format, int flags)
/* end setting sw-params */
mp_msg(MSGT_AO,MSGL_V,"alsa: %d Hz/%d channels/%d bpf/%d bytes buffer/%s\n",
- ao_data.samplerate, ao_data.channels, bytes_per_sample, ao_data.buffersize,
+ ao_data.samplerate, ao_data.channels, (int)bytes_per_sample, ao_data.buffersize,
snd_pcm_format_description(alsa_format));
} // end switch alsa_handler (spdif)
@@ -765,6 +765,10 @@ static void audio_resume(void)
{
int err;
+ if (snd_pcm_state(alsa_handler) == SND_PCM_STATE_SUSPENDED) {
+ mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_PcmInSuspendModeTryingResume);
+ while ((err = snd_pcm_resume(alsa_handler)) == -EAGAIN) sleep(1);
+ }
if (alsa_can_pause) {
if ((err = snd_pcm_pause(alsa_handler, 0)) < 0)
{
diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c
index 2da0073da7..645c9e9685 100644
--- a/libao2/ao_sdl.c
+++ b/libao2/ao_sdl.c
@@ -52,7 +52,7 @@ LIBAO_EXTERN(sdl)
#undef USE_SDL_INTERNAL_MIXER
// Samplesize used by the SDLlib AudioSpec struct
-#if defined(WIN32) || defined(__AMIGAOS4__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__AMIGAOS4__)
#define SAMPLESIZE 2048
#else
#define SAMPLESIZE 1024