diff options
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_alsa.c | 107 | ||||
-rw-r--r-- | libao2/ao_alsa5.c | 46 | ||||
-rw-r--r-- | libao2/ao_arts.c | 12 | ||||
-rw-r--r-- | libao2/ao_dxr2.c | 4 | ||||
-rw-r--r-- | libao2/ao_esd.c | 6 | ||||
-rw-r--r-- | libao2/ao_ivtv.c | 2 | ||||
-rw-r--r-- | libao2/ao_mpegpes.c | 4 | ||||
-rw-r--r-- | libao2/ao_oss.c | 24 | ||||
-rw-r--r-- | libao2/ao_pcm.c | 6 | ||||
-rw-r--r-- | libao2/ao_sdl.c | 12 | ||||
-rw-r--r-- | libao2/ao_sgi.c | 28 | ||||
-rw-r--r-- | libao2/ao_sun.c | 8 | ||||
-rw-r--r-- | libao2/ao_v4l2.c | 2 | ||||
-rw-r--r-- | libao2/audio_out.c | 10 |
14 files changed, 139 insertions, 132 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index cc92754051..c95aed4cf7 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -148,7 +148,7 @@ static int control(int cmd, void *arg) if (*test_mix_index){ mp_tmsg(MSGT_AO,MSGL_ERR, - MSGTR_AO_ALSA_InvalidMixerIndexDefaultingToZero); + "[AO_ALSA] Invalid mixer index. Defaulting to 0.\n"); mix_index = 0 ; } } @@ -168,32 +168,32 @@ static int control(int cmd, void *arg) } if ((err = snd_mixer_open(&handle, 0)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerOpenError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Mixer open error: %s\n", snd_strerror(err)); return CONTROL_ERROR; } if ((err = snd_mixer_attach(handle, card)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerAttachError, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Mixer attach %s error: %s\n", card, snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; } if ((err = snd_mixer_selem_register(handle, NULL, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerRegisterError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Mixer register error: %s\n", snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; } err = snd_mixer_load(handle); if (err < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerLoadError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Mixer load error: %s\n", snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; } elem = snd_mixer_find_selem(handle, sid); if (!elem) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToFindSimpleControl, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to find simple control '%s',%i.\n", snd_mixer_selem_id_get_name(sid), snd_mixer_selem_id_get_index(sid)); snd_mixer_close(handle); return CONTROL_ERROR; @@ -208,7 +208,7 @@ static int control(int cmd, void *arg) //setting channels if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingLeftChannel, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Error setting left channel, %s\n", snd_strerror(err)); return CONTROL_ERROR; } @@ -217,7 +217,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, SND_MIXER_SCHN_FRONT_RIGHT, set_vol)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingRightChannel, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Error setting right channel, %s\n", snd_strerror(err)); return CONTROL_ERROR; } @@ -265,7 +265,14 @@ static void parse_device (char *dest, const char *src, int len) static void print_help (void) { mp_tmsg (MSGT_AO, MSGL_FATAL, - MSGTR_AO_ALSA_CommandlineHelp); + "\n[AO_ALSA] -ao alsa commandline help:\n"\ + "[AO_ALSA] Example: mplayer -ao alsa:device=hw=0.3\n"\ + "[AO_ALSA] Sets first card fourth hardware device.\n\n"\ + "[AO_ALSA] Options:\n"\ + "[AO_ALSA] noblock\n"\ + "[AO_ALSA] Opens device in non-blocking mode.\n"\ + "[AO_ALSA] device=<device-name>\n"\ + "[AO_ALSA] Sets device (change , to . and : to =)\n"); } static int str_maxlen(strarg_t *str) { @@ -453,7 +460,7 @@ static int init(int rate_hz, int channels, int format, int flags) break; default: device.str = "default"; - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ChannelsNotSupported,channels); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] %d channels are not supported.\n",channels); } device.len = strlen(device.str); if (subopt_parse(ao_subdevice, subopts) != 0) { @@ -513,19 +520,19 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = try_open_device(alsa_device, open_mode, format == AF_FORMAT_AC3)) < 0) { if (err != -EBUSY && ao_noblock) { - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO_ALSA] Open in nonblock-mode failed, trying to open in block-mode.\n"); if ((err = try_open_device(alsa_device, 0, format == AF_FORMAT_AC3)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Playback open error: %s\n", snd_strerror(err)); return 0; } } else { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Playback open error: %s\n", snd_strerror(err)); return 0; } } if ((err = snd_pcm_nonblock(alsa_handler, 0)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSetBlockMode, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AL_ALSA] Error setting block-mode %s.\n", snd_strerror(err)); } else { mp_msg(MSGT_AO,MSGL_V,"alsa-init: pcm opened in blocking mode\n"); } @@ -536,7 +543,7 @@ static int init(int rate_hz, int channels, int format, int flags) // setting hw-parameters if ((err = snd_pcm_hw_params_any(alsa_handler, alsa_hwparams)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetInitialParameters, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to get initial parameters: %s\n", snd_strerror(err)); return 0; } @@ -544,7 +551,7 @@ static int init(int rate_hz, int channels, int format, int flags) err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); if (err < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetAccessType, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set access type: %s\n", snd_strerror(err)); return 0; } @@ -555,7 +562,7 @@ static int init(int rate_hz, int channels, int format, int flags) alsa_format)) < 0) { mp_tmsg(MSGT_AO,MSGL_INFO, - MSGTR_AO_ALSA_FormatNotSupportedByHardware, af_fmt2str_short(format)); + "[AO_ALSA] Format %s is not supported by hardware, trying default.\n", af_fmt2str_short(format)); alsa_format = SND_PCM_FORMAT_S16_LE; ao_data.format = AF_FORMAT_S16_LE; } @@ -563,7 +570,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_hw_params_set_format(alsa_handler, alsa_hwparams, alsa_format)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetFormat, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set format: %s\n", snd_strerror(err)); return 0; } @@ -571,7 +578,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_hw_params_set_channels_near(alsa_handler, alsa_hwparams, &ao_data.channels)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetChannels, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set channels: %s\n", snd_strerror(err)); return 0; } @@ -582,7 +589,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_hw_params_set_rate_resample(alsa_handler, alsa_hwparams, 0)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToDisableResampling, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to disable resampling: %s\n", snd_strerror(err)); return 0; } @@ -591,7 +598,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams, &ao_data.samplerate, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetSamplerate2, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set samplerate-2: %s\n", snd_strerror(err)); return 0; } @@ -608,7 +615,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_hw_params_set_buffer_time_near(alsa_handler, alsa_hwparams, &alsa_buffer_time, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetBufferTimeNear, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set buffer time near: %s\n", snd_strerror(err)); return 0; } else @@ -618,11 +625,11 @@ static int init(int rate_hz, int channels, int format, int flags) &alsa_period_time, NULL)) < 0) /* original: alsa_buffer_time/ao_data.bps */ { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetPeriodTime, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set period time: %s\n", snd_strerror(err)); return 0; } - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_BufferTimePeriodTime, + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO_ALSA] buffer_time: %d, period_time :%d\n", alsa_buffer_time, err); } #endif//end SET_BUFFERTIME @@ -633,7 +640,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_hw_params_set_period_size_near(alsa_handler, alsa_hwparams, &chunk_size, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetPeriodSize, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO ALSA] Unable to set period size(%ld): %s\n", chunk_size, snd_strerror(err)); return 0; } @@ -642,7 +649,7 @@ static int init(int rate_hz, int channels, int format, int flags) } if ((err = snd_pcm_hw_params_set_periods_near(alsa_handler, alsa_hwparams, &alsa_fragcount, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetPeriods, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set periods: %s\n", snd_strerror(err)); return 0; } @@ -655,7 +662,7 @@ static int init(int rate_hz, int channels, int format, int flags) /* finally install hardware parameters */ if ((err = snd_pcm_hw_params(alsa_handler, alsa_hwparams)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetHwParameters, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set hw-parameters: %s\n", snd_strerror(err)); return 0; } @@ -665,7 +672,7 @@ static int init(int rate_hz, int channels, int format, int flags) // gets buffersize for control if ((err = snd_pcm_hw_params_get_buffer_size(alsa_hwparams, &bufsize)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetBufferSize, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to get buffersize: %s\n", snd_strerror(err)); return 0; } else { @@ -674,7 +681,7 @@ static int init(int rate_hz, int channels, int format, int flags) } if ((err = snd_pcm_hw_params_get_period_size(alsa_hwparams, &chunk_size, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetPeriodSize, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO ALSA] Unable to get period size: %s\n", snd_strerror(err)); return 0; } else { mp_msg(MSGT_AO,MSGL_V,"alsa-init: got period size %li\n", chunk_size); @@ -683,13 +690,13 @@ static int init(int rate_hz, int channels, int format, int flags) /* setting software parameters */ if ((err = snd_pcm_sw_params_current(alsa_handler, alsa_swparams)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetSwParameters, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to get sw-parameters: %s\n", snd_strerror(err)); return 0; } #if SND_LIB_VERSION >= 0x000901 if ((err = snd_pcm_sw_params_get_boundary(alsa_swparams, &boundary)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetBoundary, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to get boundary: %s\n", snd_strerror(err)); return 0; } @@ -698,26 +705,26 @@ static int init(int rate_hz, int channels, int format, int flags) #endif /* start playing when one period has been written */ if ((err = snd_pcm_sw_params_set_start_threshold(alsa_handler, alsa_swparams, chunk_size)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetStartThreshold, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set start threshold: %s\n", snd_strerror(err)); return 0; } /* disable underrun reporting */ if ((err = snd_pcm_sw_params_set_stop_threshold(alsa_handler, alsa_swparams, boundary)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetStopThreshold, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set stop threshold: %s\n", snd_strerror(err)); return 0; } #if SND_LIB_VERSION >= 0x000901 /* play silence when there is an underrun */ if ((err = snd_pcm_sw_params_set_silence_size(alsa_handler, alsa_swparams, boundary)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetSilenceSize, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set silence size: %s\n", snd_strerror(err)); return 0; } #endif if ((err = snd_pcm_sw_params(alsa_handler, alsa_swparams)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetSwParameters, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to get sw-parameters: %s\n", snd_strerror(err)); return 0; } @@ -745,7 +752,7 @@ static void uninit(int immed) if ((err = snd_pcm_close(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmCloseError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm close error: %s\n", snd_strerror(err)); return; } else { @@ -754,7 +761,7 @@ static void uninit(int immed) } } else { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_NoHandlerDefined); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] No handler defined!\n"); } } @@ -765,7 +772,7 @@ static void audio_pause(void) if (alsa_can_pause) { if ((err = snd_pcm_pause(alsa_handler, 1)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPauseError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm pause error: %s\n", snd_strerror(err)); return; } mp_msg(MSGT_AO,MSGL_V,"alsa-pause: pause supported by hardware\n"); @@ -776,7 +783,7 @@ static void audio_pause(void) if ((err = snd_pcm_drop(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmDropError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm drop error: %s\n", snd_strerror(err)); return; } } @@ -787,20 +794,20 @@ static void audio_resume(void) int err; if (snd_pcm_state(alsa_handler) == SND_PCM_STATE_SUSPENDED) { - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_PcmInSuspendModeTryingResume); + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO_ALSA] Pcm in suspend mode, trying to resume.\n"); while ((err = snd_pcm_resume(alsa_handler)) == -EAGAIN) sleep(1); } if (alsa_can_pause) { if ((err = snd_pcm_pause(alsa_handler, 0)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmResumeError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm resume error: %s\n", snd_strerror(err)); return; } mp_msg(MSGT_AO,MSGL_V,"alsa-resume: resume supported by hardware\n"); } else { if ((err = snd_pcm_prepare(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm prepare error: %s\n", snd_strerror(err)); return; } if (prepause_frames) { @@ -819,12 +826,12 @@ static void reset(void) prepause_frames = 0; if ((err = snd_pcm_drop(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm prepare error: %s\n", snd_strerror(err)); return; } if ((err = snd_pcm_prepare(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm prepare error: %s\n", snd_strerror(err)); return; } return; @@ -845,7 +852,7 @@ static int play(void* data, int len, int flags) //mp_msg(MSGT_AO,MSGL_ERR,"alsa-play: frames=%i, len=%i\n",num_frames,len); if (!alsa_handler) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_DeviceConfigurationError); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Device configuration error."); return 0; } @@ -860,15 +867,15 @@ static int play(void* data, int len, int flags) res = 0; } else if (res == -ESTRPIPE) { /* suspend */ - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_PcmInSuspendModeTryingResume); + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO_ALSA] Pcm in suspend mode, trying to resume.\n"); while ((res = snd_pcm_resume(alsa_handler)) == -EAGAIN) sleep(1); } if (res < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_WriteError, snd_strerror(res)); - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_TryingToResetSoundcard); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Write error: %s\n", snd_strerror(res)); + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO_ALSA] Trying to reset soundcard.\n"); if ((res = snd_pcm_prepare(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(res)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] pcm prepare error: %s\n", snd_strerror(res)); return 0; break; } @@ -888,7 +895,7 @@ static int get_space(void) if ((ret = snd_pcm_status(alsa_handler, status)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_CannotGetPcmStatus, snd_strerror(ret)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Cannot get pcm status: %s\n", snd_strerror(ret)); return 0; } diff --git a/libao2/ao_alsa5.c b/libao2/ao_alsa5.c index 310725d88d..bca4e93ed8 100644 --- a/libao2/ao_alsa5.c +++ b/libao2/ao_alsa5.c @@ -65,7 +65,7 @@ static int init(int rate_hz, int channels, int format, int flags) snd_pcm_info_t info; snd_pcm_channel_info_t chninfo; - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_InitInfo, rate_hz, + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO ALSA5] alsa-init: requested format: %d Hz, %d channels, %s\n", rate_hz, channels, af_fmt2str_short(format)); alsa_handler = NULL; @@ -75,7 +75,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((cards = snd_cards()) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_SoundCardNotFound); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: no soundcards found.\n"); return 0; } @@ -125,7 +125,7 @@ static int init(int rate_hz, int channels, int format, int flags) ao_data.bps *= 2; break; case -1: - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,af_fmt2str_short(format)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: invalid format (%s) requested - output disabled.\n",af_fmt2str_short(format)); return 0; default: break; @@ -177,17 +177,17 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_open(&alsa_handler, 0, 0, SND_PCM_OPEN_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlayBackError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: playback open error: %s\n", snd_strerror(err)); return 0; } if ((err = snd_pcm_info(alsa_handler, &info)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmInfoError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: PCM info error: %s\n", snd_strerror(err)); return 0; } - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_SoundcardsFound, + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO ALSA5] alsa-init: %d soundcard(s) found, using: %s\n", cards, info.name); if (info.flags & SND_PCM_INFO_PLAYBACK) @@ -196,7 +196,7 @@ static int init(int rate_hz, int channels, int format, int flags) chninfo.channel = SND_PCM_CHANNEL_PLAYBACK; if ((err = snd_pcm_channel_info(alsa_handler, &chninfo)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmChanInfoError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: PCM channel info error: %s\n", snd_strerror(err)); return 0; } @@ -220,7 +220,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_channel_params(alsa_handler, ¶ms)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetParms, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: error setting parameters: %s\n", snd_strerror(err)); return 0; } @@ -233,13 +233,13 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_pcm_channel_setup(alsa_handler, &setup)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetChan, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: error setting up channel: %s\n", snd_strerror(err)); return 0; } if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ChanPrepareError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: channel prepare error: %s\n", snd_strerror(err)); return 0; } @@ -256,19 +256,19 @@ static void uninit(int immed) if ((err = snd_pcm_playback_drain(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_DrainError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-uninit: playback drain error: %s\n", snd_strerror(err)); return; } if ((err = snd_pcm_channel_flush(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_FlushError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-uninit: playback flush error: %s\n", snd_strerror(err)); return; } if ((err = snd_pcm_close(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmCloseError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-uninit: PCM close error: %s\n", snd_strerror(err)); return; } } @@ -280,19 +280,19 @@ static void reset(void) if ((err = snd_pcm_playback_drain(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResetDrainError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-reset: playback drain error: %s\n", snd_strerror(err)); return; } if ((err = snd_pcm_channel_flush(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResetFlushError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-reset: playback flush error: %s\n", snd_strerror(err)); return; } if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResetChanPrepareError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-reset: channel prepare error: %s\n", snd_strerror(err)); return; } } @@ -304,13 +304,13 @@ static void audio_pause(void) if ((err = snd_pcm_playback_drain(alsa_handler)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PauseDrainError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-pause: playback drain error: %s\n", snd_strerror(err)); return; } if ((err = snd_pcm_channel_flush(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PauseFlushError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-pause: playback flush error: %s\n", snd_strerror(err)); return; } } @@ -321,7 +321,7 @@ static void audio_resume(void) int err; if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResumePrepareError, snd_strerror(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-resume: channel prepare error: %s\n", snd_strerror(err)); return; } } @@ -341,21 +341,21 @@ static int play(void* data, int len, int flags) { if (got_len == -EPIPE) /* underrun? */ { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_Underrun); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-play: alsa underrun, resetting stream.\n"); if ((got_len = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlaybackPrepareError, snd_strerror(got_len)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-play: playback prepare error: %s\n", snd_strerror(got_len)); return 0; } if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_WriteErrorAfterReset, + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-play: write error after reset: %s - giving up.\n", snd_strerror(got_len)); return 0; } return got_len; /* 2nd write was ok */ } - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_OutPutError, snd_strerror(got_len)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-play: output error: %s\n", snd_strerror(got_len)); return 0; } return got_len; diff --git a/libao2/ao_arts.c b/libao2/ao_arts.c index 38f3d8d4a4..1d1638ba2d 100644 --- a/libao2/ao_arts.c +++ b/libao2/ao_arts.c @@ -59,10 +59,10 @@ static int init(int rate_hz, int channels, int format, int flags) int frag_spec; if( (err=arts_init()) ) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ARTS_CantInit, arts_error_text(err)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ARTS] %s\n", arts_error_text(err)); return 0; } - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_ServerConnect); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO ARTS] Connected to sound server.\n"); /* * arts supports 8bit unsigned and 16bit signed sample formats @@ -93,7 +93,7 @@ static int init(int rate_hz, int channels, int format, int flags) stream=arts_play_stream(rate_hz, OBTAIN_BITRATE(format), channels, "MPlayer"); if(stream == NULL) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ARTS_CantOpenStream); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ARTS] Unable to open a stream.\n"); arts_free(); return 0; } @@ -104,11 +104,11 @@ static int init(int rate_hz, int channels, int format, int flags) frag_spec = ARTS_PACKET_SIZE_LOG2 | ARTS_PACKETS << 16; arts_stream_set(stream, ARTS_P_PACKET_SETTINGS, frag_spec); ao_data.buffersize = arts_stream_get(stream, ARTS_P_BUFFER_SIZE); - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_StreamOpen); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO ARTS] Stream opened.\n"); - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_BufferSize, + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO ARTS] buffer size: %d\n", ao_data.buffersize); - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_BufferSize, + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO ARTS] buffer size: %d\n", arts_stream_get(stream, ARTS_P_PACKET_SIZE)); return 1; diff --git a/libao2/ao_dxr2.c b/libao2/ao_dxr2.c index 57926dac0b..51cd1a0d01 100644 --- a/libao2/ao_dxr2.c +++ b/libao2/ao_dxr2.c @@ -73,7 +73,7 @@ static int control(int cmd,void *arg){ if(v.arg != volume) { volume = v.arg; if( ioctl(dxr2_fd,DXR2_IOC_SET_AUDIO_VOLUME,&v) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_DXR2_SetVolFailed,volume); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO DXR2] Setting volume to %d failed.\n",volume); return CONTROL_ERROR; } } @@ -135,7 +135,7 @@ static int init(int rate,int channels,int format,int flags){ break; #endif default: - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_DXR2_UnsupSamplerate,rate); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO DXR2] %d Hz not supported, try to resample.\n",rate); return 0; } diff --git a/libao2/ao_esd.c b/libao2/ao_esd.c index 9d9e594cec..7a9ad96170 100644 --- a/libao2/ao_esd.c +++ b/libao2/ao_esd.c @@ -168,7 +168,7 @@ static int init(int rate_hz, int channels, int format, int flags) if (esd_fd < 0) { esd_fd = esd_open_sound(server); if (esd_fd < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ESD_CantOpenSound, + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ESD] esd_open_sound failed: %s\n", strerror(errno)); return 0; } @@ -245,14 +245,14 @@ static int init(int rate_hz, int channels, int format, int flags) lag_serv = (esd_latency * 4.0f) / (bytes_per_sample * rate_hz); lag_seconds = lag_net + lag_serv; audio_delay += lag_seconds; - mp_tmsg(MSGT_AO, MSGL_INFO,MSGTR_AO_ESD_LatencyInfo, + mp_tmsg(MSGT_AO, MSGL_INFO,"[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n", lag_serv, lag_net, lag_seconds); } esd_play_fd = esd_play_stream_fallback(esd_fmt, rate_hz, server, ESD_CLIENT_NAME); if (esd_play_fd < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_ESD_CantOpenPBStream, strerror(errno)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ESD] failed to open ESD playback stream: %s\n", strerror(errno)); return 0; } diff --git a/libao2/ao_ivtv.c b/libao2/ao_ivtv.c index adeefb464e..22e2f49a74 100644 --- a/libao2/ao_ivtv.c +++ b/libao2/ao_ivtv.c @@ -86,7 +86,7 @@ init (int rate, int channels, int format, int flags) /* check for supported audio rate */ if (rate != 32000 || rate != 41000 || rate != 48000) { - mp_tmsg (MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_UnsupSamplerate, rate); + mp_tmsg (MSGT_AO, MSGL_ERR, "[AO MPEGPES] %d Hz not supported, try to resample.\n", rate); rate = 48000; } diff --git a/libao2/ao_mpegpes.c b/libao2/ao_mpegpes.c index 3d66aca814..e8c0f01d14 100644 --- a/libao2/ao_mpegpes.c +++ b/libao2/ao_mpegpes.c @@ -97,7 +97,7 @@ static int control(int cmd,void *arg){ if(dvb_mixer.volume_right>255) dvb_mixer.volume_right=255; // printf("Setting DVB volume: %d ; %d \n",dvb_mixer.volume_left,dvb_mixer.volume_right); if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MIXER, &dvb_mixer) < 0)){ - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_CantSetMixer, + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO MPEGPES] DVB audio set mixer failed: %s.\n", strerror(errno)); return CONTROL_ERROR; } @@ -263,7 +263,7 @@ static int init(int rate,int channels,int format,int flags){ case 44100: freq_id=2;break; case 32000: freq_id=3;break; default: - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_UnsupSamplerate, rate); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO MPEGPES] %d Hz not supported, try to resample.\n", rate); #if 0 if(rate>48000) rate=96000; else if(rate>44100) rate=48000; else diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index ad2a595c47..c331f8331b 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -160,7 +160,7 @@ static int oss2format(int format) case AFMT_AC3: return AF_FORMAT_AC3; #endif } - mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_AO_OSS_UnknownUnsupportedFormat, format); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[AO OSS] Unknown/Unsupported OSS format: %x.\n", format); return -1; } @@ -294,7 +294,7 @@ static int init(int rate,int channels,int format,int flags){ int fd, devs, i; if ((fd = open(oss_mixer_device, O_RDONLY)) == -1){ - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantOpenMixer, + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Can't open mixer device %s: %s\n", oss_mixer_device, strerror(errno)); }else{ ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs); @@ -303,7 +303,7 @@ static int init(int rate,int channels,int format,int flags){ for (i=0; i<SOUND_MIXER_NRDEVICES; i++){ if(!strcasecmp(mixer_channels[i], mchan)){ if(!(devs & (1 << i))){ - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_ChanNotFound,mchan); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Audio card mixer does not have channel '%s', using default.\n",mchan); i = SOUND_MIXER_NRDEVICES+1; break; } @@ -312,7 +312,7 @@ static int init(int rate,int channels,int format,int flags){ } } if(i==SOUND_MIXER_NRDEVICES){ - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_ChanNotFound,mchan); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Audio card mixer does not have channel '%s', using default.\n",mchan); } } } else @@ -328,14 +328,14 @@ static int init(int rate,int channels,int format,int flags){ audio_fd=open(dsp, O_WRONLY); #endif if(audio_fd<0){ - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantOpenDev, dsp, strerror(errno)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Can't open audio device %s: %s\n", dsp, strerror(errno)); return 0; } #ifdef __linux__ /* Remove the non-blocking flag */ if(fcntl(audio_fd, F_SETFL, 0) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantMakeFd, strerror(errno)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Can't make file descriptor blocking: %s\n", strerror(errno)); return 0; } #endif @@ -362,7 +362,7 @@ ac3_retry: } if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &oss_format)<0 || oss_format != format2oss(format)) { - mp_tmsg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSet, dsp, + mp_tmsg(MSGT_AO,MSGL_WARN, "[AO OSS] Can't set audio device %s to %s output, trying %s...\n", dsp, af_fmt2str_short(format), af_fmt2str_short(AF_FORMAT_S16_NE) ); format=AF_FORMAT_S16_NE; goto ac3_retry; @@ -384,14 +384,14 @@ ac3_retry: if (ao_data.channels > 2) { if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels) == -1 || ao_data.channels != channels ) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantSetChans, channels); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Failed to set audio device to %d channels.\n", channels); return 0; } } else { int c = ao_data.channels-1; if (ioctl (audio_fd, SNDCTL_DSP_STEREO, &c) == -1) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantSetChans, ao_data.channels); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Failed to set audio device to %d channels.\n", ao_data.channels); return 0; } ao_data.channels=c+1; @@ -405,7 +405,7 @@ ac3_retry: if(ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &zz)==-1){ int r=0; - mp_tmsg(MSGT_AO,MSGL_WARN,MSGTR_AO_OSS_CantUseGetospace); + mp_tmsg(MSGT_AO,MSGL_WARN,"[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n"); if(ioctl(audio_fd, SNDCTL_DSP_GETBLKSIZE, &r)==-1){ mp_msg(MSGT_AO,MSGL_V,"audio_setup: %d bytes/frag (config.h)\n",ao_data.outburst); } else { @@ -436,7 +436,7 @@ ac3_retry: } free(data); if(ao_data.buffersize==0){ - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantUseSelect); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS]\n *** Your audio driver DOES NOT support select() ***\n Recompile MPlayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"); return 0; } #endif @@ -474,7 +474,7 @@ static void reset(void){ uninit(1); audio_fd=open(dsp, O_WRONLY); if(audio_fd < 0){ - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantReopen, strerror(errno)); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n", strerror(errno)); return; } diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index d5be3b9cf6..8940107eec 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -154,10 +154,10 @@ static int init(int rate,int channels,int format,int flags){ wavhdr.data_length=le2me_32(0x7ffff000); wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n", ao_outputfilename, (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast\n[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).\n"); fp = fopen(ao_outputfilename, "wb"); if(fp) { @@ -166,7 +166,7 @@ static int init(int rate,int channels,int format,int flags){ } return 1; } - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_PCM_CantOpenOutputFile, + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO PCM] Failed to open %s for writing!\n", ao_outputfilename); return 0; } diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c index 13a9a95447..66d37eae77 100644 --- a/libao2/ao_sdl.c +++ b/libao2/ao_sdl.c @@ -133,11 +133,11 @@ static int init(int rate,int channels,int format,int flags){ /* Allocate ring-buffer memory */ buffer = av_fifo_alloc(BUFFSIZE); - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_INFO, rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO SDL] Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); if(ao_subdevice) { setenv("SDL_AUDIODRIVER", ao_subdevice, 1); - mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_DriverInfo, ao_subdevice); + mp_tmsg(MSGT_AO,MSGL_INFO,"[AO SDL] using %s audio driver.\n", ao_subdevice); } ao_data.channels=channels; @@ -171,7 +171,7 @@ static int init(int rate,int channels,int format,int flags){ default: aspec.format = AUDIO_S16LSB; ao_data.format = AF_FORMAT_S16_LE; - mp_tmsg(MSGT_AO,MSGL_WARN,MSGTR_AO_SDL_UnsupportedAudioFmt, format); + mp_tmsg(MSGT_AO,MSGL_WARN,"[AO SDL] Unsupported audio format: 0x%x.\n", format); } /* The desired audio frequency in samples-per-second. */ @@ -192,13 +192,13 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s /* initialize the SDL Audio system */ if (SDL_Init (SDL_INIT_AUDIO/*|SDL_INIT_NOPARACHUTE*/)) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_SDL_CantInit, SDL_GetError()); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO SDL] SDL Audio initialization failed: %s\n", SDL_GetError()); return 0; } /* Open the audio device and start playing sound! */ if(SDL_OpenAudio(&aspec, &obtained) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_SDL_CantOpenAudio, SDL_GetError()); + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO SDL] Unable to open audio: %s\n", SDL_GetError()); return 0; } @@ -226,7 +226,7 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s ao_data.format = AF_FORMAT_U16_BE; break; default: - mp_tmsg(MSGT_AO,MSGL_WARN,MSGTR_AO_SDL_UnsupportedAudioFmt, obtained.format); + mp_tmsg(MSGT_AO,MSGL_WARN,"[AO SDL] Unsupported audio format: 0x%x.\n", obtained.format); return 0; } diff --git a/libao2/ao_sgi.c b/libao2/ao_sgi.c index 89d4176889..8a2899d915 100644 --- a/libao2/ao_sgi.c +++ b/libao2/ao_sgi.c @@ -117,7 +117,7 @@ static int fmt2sgial(int *format, int *width) { // to set/get/query special features/parameters static int control(int cmd, void *arg){ - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_INFO); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] control.\n"); switch(cmd) { case AOCONTROL_QUERY_FORMAT: @@ -138,7 +138,7 @@ static int init(int rate, int channels, int format, int flags) { smpfmt = fmt2sgial(&format, &smpwidth); - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_InitInfo, rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] init: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); { /* from /usr/share/src/dmedia/audio/setrate.c */ @@ -148,7 +148,7 @@ static int init(int rate, int channels, int format, int flags) { if(ao_subdevice) { rv = alGetResourceByName(AL_SYSTEM, ao_subdevice, AL_OUTPUT_DEVICE_TYPE); if (!rv) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InvalidDevice); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] play: invalid device.\n"); return 0; } } @@ -161,20 +161,20 @@ static int init(int rate, int channels, int format, int flags) { x[1].value.i = AL_CRYSTAL_MCLK_TYPE; if (alSetParams(rv,x, 2)<0) { - mp_tmsg(MSGT_AO, MSGL_WARN, MSGTR_AO_SGI_CantSetParms_Samplerate, alGetErrorString(oserror())); + mp_tmsg(MSGT_AO, MSGL_WARN, "[AO SGI] init: setparams failed: %s\nCould not set desired samplerate.\n", alGetErrorString(oserror())); } if (x[0].sizeOut < 0) { - mp_tmsg(MSGT_AO, MSGL_WARN, MSGTR_AO_SGI_CantSetAlRate); + mp_tmsg(MSGT_AO, MSGL_WARN, "[AO SGI] init: AL_RATE was not accepted on the given resource.\n"); } if (alGetParams(rv,x, 1)<0) { - mp_tmsg(MSGT_AO, MSGL_WARN, MSGTR_AO_SGI_CantGetParms, alGetErrorString(oserror())); + mp_tmsg(MSGT_AO, MSGL_WARN, "[AO SGI] init: getparams failed: %s\n", alGetErrorString(oserror())); } realrate = alFixedToDouble(x[0].value.ll); if (frate != realrate) { - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_SampleRateInfo, realrate, frate); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] init: samplerate is now %lf (desired rate is %lf)\n", realrate, frate); } sample_rate = (int)realrate; } @@ -191,7 +191,7 @@ static int init(int rate, int channels, int format, int flags) { ao_config = alNewConfig(); if (!ao_config) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InitConfigError, alGetErrorString(oserror())); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] init: %s\n", alGetErrorString(oserror())); return 0; } @@ -200,14 +200,14 @@ static int init(int rate, int channels, int format, int flags) { alSetSampFmt(ao_config, smpfmt) < 0 || alSetQueueSize(ao_config, sample_rate) < 0 || alSetDevice(ao_config, rv) < 0) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InitConfigError, alGetErrorString(oserror())); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] init: %s\n", alGetErrorString(oserror())); return 0; } ao_port = alOpenPort("mplayer", "w", ao_config); if (!ao_port) { - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InitOpenAudioFailed, alGetErrorString(oserror())); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] init: Unable to open audio channel: %s\n", alGetErrorString(oserror())); return 0; } @@ -222,7 +222,7 @@ static void uninit(int immed) { /* TODO: samplerate should be set back to the value before mplayer was started! */ - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_Uninit); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] uninit: ...\n"); if (ao_config) { alFreeConfig(ao_config); @@ -241,7 +241,7 @@ static void uninit(int immed) { // stop playing and empty buffers (for seeking/pause) static void reset(void) { - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_Reset); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] reset: ...\n"); alDiscardFrames(ao_port, queue_size); } @@ -249,14 +249,14 @@ static void reset(void) { // stop playing, keep buffers (for pause) static void audio_pause(void) { - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_PauseInfo); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] audio_pause: ...\n"); } // resume playing, after audio_pause() static void audio_resume(void) { - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_ResumeInfo); + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] audio_resume: ...\n"); } diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c index f1b002feb1..d2da673177 100644 --- a/libao2/ao_sun.c +++ b/libao2/ao_sun.c @@ -154,13 +154,13 @@ static int realtime_samplecounter_available(char *dev) info.play.samples = 0; if (ioctl(fd, AUDIO_SETINFO, &info)) { if ( mp_msg_test(MSGT_AO,MSGL_V) ) - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_RtscSetinfoFailed); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SUN] rtsc: SETINFO failed.\n"); goto error; } if (write(fd, silence, len) != len) { if ( mp_msg_test(MSGT_AO,MSGL_V) ) - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_RtscWriteFailed); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SUN] rtsc: write failed.\n"); goto error; } @@ -494,7 +494,7 @@ static int init(int rate,int channels,int format,int flags){ audio_fd=open(audio_dev, O_WRONLY); if(audio_fd<0){ - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_CantOpenAudioDev, audio_dev, strerror(errno)); + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SUN] Can't open audio device %s, %s -> nosound.\n", audio_dev, strerror(errno)); return 0; } @@ -572,7 +572,7 @@ static int init(int rate,int channels,int format,int flags){ if (!ok) { char buf[128]; - mp_tmsg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_UnsupSampleRate, + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SUN] audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate.\n", channels, af_fmt2str(format, buf, 128), rate); return 0; } diff --git a/libao2/ao_v4l2.c b/libao2/ao_v4l2.c index fddc7c9450..c1e0671835 100644 --- a/libao2/ao_v4l2.c +++ b/libao2/ao_v4l2.c @@ -83,7 +83,7 @@ init (int rate, int channels, int format, int flags) /* check for supported audio rate */ if (rate != 32000 || rate != 41000 || rate != 48000) { - mp_tmsg (MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_UnsupSamplerate, rate); + mp_tmsg (MSGT_AO, MSGL_ERR, "[AO MPEGPES] %d Hz not supported, try to resample.\n", rate); rate = 48000; } diff --git a/libao2/audio_out.c b/libao2/audio_out.c index 76ccbbb045..ab40121d76 100644 --- a/libao2/audio_out.c +++ b/libao2/audio_out.c @@ -124,7 +124,7 @@ const ao_functions_t* const audio_out_drivers[] = void list_audio_out(void){ int i=0; - mp_tmsg(MSGT_AO, MSGL_INFO, MSGTR_AvailableAudioOutputDrivers); + mp_tmsg(MSGT_AO, MSGL_INFO, "Available audio output drivers:\n"); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_OUTPUTS\n"); while (audio_out_drivers[i]) { const ao_info_t *info = audio_out_drivers[i++]->info; @@ -152,7 +152,7 @@ const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate else ao_len = strlen(ao); - mp_tmsg(MSGT_AO, MSGL_V, MSGTR_AO_TryingPreferredAudioDriver, + mp_tmsg(MSGT_AO, MSGL_V, "Trying preferred audio driver '%.*s', options '%s'\n", ao_len, ao, ao_subdevice ? ao_subdevice : "[none]"); for(i=0;audio_out_drivers[i];i++){ @@ -162,12 +162,12 @@ const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate if(audio_out->init(rate,channels,format,flags)) return audio_out; // success! else - mp_tmsg(MSGT_AO, MSGL_WARN, MSGTR_AO_FailedInit, ao); + mp_tmsg(MSGT_AO, MSGL_WARN, "Failed to initialize audio driver '%s'\n", ao); break; } } if (!audio_out_drivers[i]) // we searched through the entire list - mp_tmsg(MSGT_AO, MSGL_WARN, MSGTR_AO_NoSuchDriver, ao_len, ao); + mp_tmsg(MSGT_AO, MSGL_WARN, "No such audio driver '%.*s'\n", ao_len, ao); // continue... ++ao_list; if(!(ao_list[0])) return NULL; // do NOT fallback to others @@ -177,7 +177,7 @@ const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate ao_subdevice = NULL; } - mp_tmsg(MSGT_AO, MSGL_V, MSGTR_AO_TryingEveryKnown); + mp_tmsg(MSGT_AO, MSGL_V, "Trying every known audio driver...\n"); // now try the rest... for(i=0;audio_out_drivers[i];i++){ |