output_api: no CamelCase in struct audio_output
Renamed audio_output struct members.
This commit is contained in:
parent
744702f266
commit
61e3075981
@ -56,22 +56,22 @@ audio_output_open(struct audio_output *audioOutput,
|
||||
audioOutput->reopen_after = 0;
|
||||
|
||||
if (audioOutput->open &&
|
||||
audio_format_equals(audioFormat, &audioOutput->inAudioFormat)) {
|
||||
audio_format_equals(audioFormat, &audioOutput->in_audio_format)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
audioOutput->inAudioFormat = *audioFormat;
|
||||
audioOutput->in_audio_format = *audioFormat;
|
||||
|
||||
if (audio_format_defined(&audioOutput->reqAudioFormat)) {
|
||||
/* copy reqAudioFormat to outAudioFormat only if the
|
||||
if (audio_format_defined(&audioOutput->config_audio_format)) {
|
||||
/* copy config_audio_format to out_audio_format only if the
|
||||
device is not yet open; if it is already open,
|
||||
plugin->open() may have modified outAudioFormat,
|
||||
plugin->open() may have modified out_audio_format,
|
||||
and the value is already ok */
|
||||
if (!audioOutput->open)
|
||||
audioOutput->outAudioFormat =
|
||||
audioOutput->reqAudioFormat;
|
||||
audioOutput->out_audio_format =
|
||||
audioOutput->config_audio_format;
|
||||
} else {
|
||||
audioOutput->outAudioFormat = audioOutput->inAudioFormat;
|
||||
audioOutput->out_audio_format = audioOutput->in_audio_format;
|
||||
if (audioOutput->open)
|
||||
audio_output_close(audioOutput);
|
||||
}
|
||||
|
@ -91,20 +91,21 @@ audio_output_init(struct audio_output *ao, const struct config_param *param)
|
||||
ao->open = false;
|
||||
ao->reopen_after = 0;
|
||||
|
||||
pcm_convert_init(&ao->convState);
|
||||
pcm_convert_init(&ao->convert_state);
|
||||
|
||||
if (format) {
|
||||
if (0 != parseAudioConfig(&ao->reqAudioFormat, format)) {
|
||||
if (0 != parseAudioConfig(&ao->config_audio_format, format)) {
|
||||
g_error("error parsing format at line %i\n", bp->line);
|
||||
}
|
||||
} else
|
||||
audio_format_clear(&ao->reqAudioFormat);
|
||||
audio_format_clear(&ao->config_audio_format);
|
||||
|
||||
ao->thread = NULL;
|
||||
notify_init(&ao->notify);
|
||||
ao->command = AO_COMMAND_NONE;
|
||||
|
||||
ao->data = plugin->init(ao, format ? &ao->reqAudioFormat : NULL, param);
|
||||
ao->data = plugin->init(ao, format ? &ao->config_audio_format : NULL,
|
||||
param);
|
||||
if (ao->data == NULL)
|
||||
return 0;
|
||||
|
||||
|
@ -63,23 +63,23 @@ struct audio_output {
|
||||
* The audio_format in which audio data is received from the
|
||||
* player thread (which in turn receives it from the decoder).
|
||||
*/
|
||||
struct audio_format inAudioFormat;
|
||||
struct audio_format in_audio_format;
|
||||
|
||||
/**
|
||||
* The audio_format which is really sent to the device. This
|
||||
* is basically reqAudioFormat (if configured) or
|
||||
* inAudioFormat, but may have been modified by
|
||||
* is basically config_audio_format (if configured) or
|
||||
* in_audio_format, but may have been modified by
|
||||
* plugin->open().
|
||||
*/
|
||||
struct audio_format outAudioFormat;
|
||||
struct audio_format out_audio_format;
|
||||
|
||||
/**
|
||||
* The audio_format which was configured. Only set if
|
||||
* convertAudioFormat is true.
|
||||
*/
|
||||
struct audio_format reqAudioFormat;
|
||||
struct audio_format config_audio_format;
|
||||
|
||||
struct pcm_convert_state convState;
|
||||
struct pcm_convert_state convert_state;
|
||||
|
||||
/**
|
||||
* The thread handle, or NULL if the output thread isn't
|
||||
|
@ -46,10 +46,10 @@ static void ao_play(struct audio_output *ao)
|
||||
|
||||
assert(size > 0);
|
||||
|
||||
if (!audio_format_equals(&ao->inAudioFormat, &ao->outAudioFormat)) {
|
||||
data = pcm_convert(&ao->convState,
|
||||
&ao->inAudioFormat, data, size,
|
||||
&ao->outAudioFormat, &size);
|
||||
if (!audio_format_equals(&ao->in_audio_format, &ao->out_audio_format)) {
|
||||
data = pcm_convert(&ao->convert_state,
|
||||
&ao->in_audio_format, data, size,
|
||||
&ao->out_audio_format, &size);
|
||||
|
||||
/* under certain circumstances, pcm_convert() may
|
||||
return an empty buffer - this condition should be
|
||||
@ -63,7 +63,7 @@ static void ao_play(struct audio_output *ao)
|
||||
if (!ret) {
|
||||
ao->plugin->cancel(ao->data);
|
||||
ao->plugin->close(ao->data);
|
||||
pcm_convert_deinit(&ao->convState);
|
||||
pcm_convert_deinit(&ao->convert_state);
|
||||
ao->open = false;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ static void ao_pause(struct audio_output *ao)
|
||||
ret = ao->plugin->pause(ao->data);
|
||||
if (!ret) {
|
||||
ao->plugin->close(ao->data);
|
||||
pcm_convert_deinit(&ao->convState);
|
||||
pcm_convert_deinit(&ao->convert_state);
|
||||
ao->open = false;
|
||||
}
|
||||
} while (ao->command == AO_COMMAND_NONE);
|
||||
@ -109,9 +109,9 @@ static gpointer audio_output_task(gpointer arg)
|
||||
case AO_COMMAND_OPEN:
|
||||
assert(!ao->open);
|
||||
|
||||
pcm_convert_init(&ao->convState);
|
||||
pcm_convert_init(&ao->convert_state);
|
||||
ret = ao->plugin->open(ao->data,
|
||||
&ao->outAudioFormat);
|
||||
&ao->out_audio_format);
|
||||
|
||||
assert(!ao->open);
|
||||
if (ret == true)
|
||||
|
Loading…
Reference in New Issue
Block a user