Commit 4bba1e84 authored by Thomas Guillem's avatar Thomas Guillem

aout: always signal when the aout changed

In a previous patch, we signaled that the aout changed when it was restarted.
We also need to signal that event when an aout module selects a device without
requesting a restart.
parent 043cde8a
......@@ -83,6 +83,7 @@ typedef struct
atomic_uint buffers_lost;
atomic_uint buffers_played;
atomic_uchar restart;
bool device_changed;
} aout_owner_t;
typedef struct
......
......@@ -83,6 +83,7 @@ int aout_DecNew( audio_output_t *p_aout,
owner->input_format = *p_format;
owner->mixer_format = owner->input_format;
owner->request_vout = *p_request_vout;
owner->device_changed = false;
if (aout_OutputNew (p_aout, &owner->mixer_format))
goto error;
......@@ -174,6 +175,11 @@ static int aout_CheckReady (audio_output_t *aout)
* left over by an audio visualization:
input_resource_TerminatVout(MAGIC HERE); */
}
if (owner->device_changed)
{
owner->device_changed = false;
status = AOUT_DEC_CHANGED;
}
return (owner->mixer_format.i_format) ? status : AOUT_DEC_FAILED;
}
......
......@@ -561,6 +561,7 @@ void aout_OutputUnlock (audio_output_t *aout)
aout_OutputDeviceSet (aout, owner->req.device);
free (owner->req.device);
owner->req.device = (char *)unset_str;
owner->device_changed = true;
}
if (owner->req.volume >= 0.f)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment