Commit 2e497105 authored by David Fuhrmann's avatar David Fuhrmann

auhal: always do a final format check in stream change function

parent 2e4af369
...@@ -1899,6 +1899,12 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea ...@@ -1899,6 +1899,12 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
UInt32 i_param_size = sizeof(AudioStreamBasicDescription); UInt32 i_param_size = sizeof(AudioStreamBasicDescription);
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
/* Callback is not always invoked. So first check if format is already set. */ /* Callback is not always invoked. So first check if format is already set. */
if (i > 0) {
mtime_t timeout = mdate() + 500000;
if (vlc_cond_timedwait(&w.cond, &w.lock, timeout))
msg_Dbg(p_aout, "reached timeout");
}
err = AudioObjectGetPropertyData(i_stream_id, &physicalFormatAddress, 0, NULL, &i_param_size, &actual_format); err = AudioObjectGetPropertyData(i_stream_id, &physicalFormatAddress, 0, NULL, &i_param_size, &actual_format);
msg_Dbg(p_aout, STREAM_FORMAT_MSG("actual format in use: ", actual_format)); msg_Dbg(p_aout, STREAM_FORMAT_MSG("actual format in use: ", actual_format));
...@@ -1910,9 +1916,6 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea ...@@ -1910,9 +1916,6 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
} }
/* We need to check again */ /* We need to check again */
mtime_t timeout = mdate() + 500000;
if (vlc_cond_timedwait(&w.cond, &w.lock, timeout))
msg_Dbg(p_aout, "reached timeout");
} }
out: out:
......
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