[vlc-commits] aout: add current_sink_info struct
Thomas Guillem
git at videolan.org
Fri Jul 21 11:19:12 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 18 18:58:47 2017 +0200| [0e644ebbf1d55799001b662d3e5bcacf6986a8ed] | committer: Thomas Guillem
aout: add current_sink_info struct
This new struct can be filled from the start() function of aout modules.
It contains (for now) only one member: the headphones state.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e644ebbf1d55799001b662d3e5bcacf6986a8ed
---
include/vlc_aout.h | 7 +++++++
src/audio_output/output.c | 2 ++
2 files changed, 9 insertions(+)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 3693c0e921..8e2fd19903 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -168,6 +168,13 @@ struct audio_output
* \return 0 on success, non-zero on failure.
* \warning A stream may or may not have been started when called.
*/
+
+ struct {
+ bool headphones; /**< Default to false, set it to true if the current
+ sink is using headphones */
+ } current_sink_info;
+ /**< Current sink informations set by the module from the start() function */
+
struct {
void (*volume_report)(audio_output_t *, float);
void (*mute_report)(audio_output_t *, bool);
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 9629c46a44..23c9aa6bfc 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -537,6 +537,8 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt,
aout_FormatPrepare (fmt);
}
+ aout->current_sink_info.headphones = false;
+
if (aout->start (aout, fmt))
{
msg_Err (aout, "module not functional");
More information about the vlc-commits
mailing list