Technically the lock doesn't need to be taken here since the data is static, however doing so keeps the implementation consistent with the others.
Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/wineoss.drv/mmdevdrv.c | 11 +++++------ dlls/wineoss.drv/oss.c | 17 +++++++++++++++++ dlls/wineoss.drv/unixlib.h | 8 ++++++++ 3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index c101d757836..6498a4750d4 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -1427,16 +1427,15 @@ static ULONG WINAPI AudioClock_Release(IAudioClock *iface) static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq) { ACImpl *This = impl_from_IAudioClock(iface); - struct oss_stream *stream = This->stream; + struct get_frequency_params params;
TRACE("(%p)->(%p)\n", This, freq);
- if(stream->share == AUDCLNT_SHAREMODE_SHARED) - *freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign; - else - *freq = stream->fmt->nSamplesPerSec; + params.stream = This->stream; + params.frequency = freq; + OSS_CALL(get_frequency, ¶ms);
- return S_OK; + return params.result; }
static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index ffea1bb8338..3a512c7cd9e 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1256,6 +1256,22 @@ static NTSTATUS get_next_packet_size(void *args) return oss_unlock_result(stream, ¶ms->result, S_OK); }
+static NTSTATUS get_frequency(void *args) +{ + struct get_frequency_params *params = args; + struct oss_stream *stream = params->stream; + UINT64 *freq = params->frequency; + + oss_lock(stream); + + if(stream->share == AUDCLNT_SHAREMODE_SHARED) + *freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign; + else + *freq = stream->fmt->nSamplesPerSec; + + return oss_unlock_result(stream, ¶ms->result, S_OK); +} + static NTSTATUS set_event_handle(void *args) { struct set_event_handle_params *params = args; @@ -1296,5 +1312,6 @@ unixlib_entry_t __wine_unix_call_funcs[] = get_latency, get_current_padding, get_next_packet_size, + get_frequency, set_event_handle, }; diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index a809ad41d3e..9a544ae7899 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -193,6 +193,13 @@ struct get_next_packet_size_params UINT32 *frames; };
+struct get_frequency_params +{ + struct oss_stream *stream; + HRESULT result; + UINT64 *frequency; +}; + struct set_event_handle_params { struct oss_stream *stream; @@ -220,6 +227,7 @@ enum oss_funcs oss_get_latency, oss_get_current_padding, oss_get_next_packet_size, + oss_get_frequency, oss_set_event_handle, };
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112675
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wineoss.drv/oss.c:1243 error: patch failed: dlls/wineoss.drv/unixlib.h:186 error: patch failed: dlls/wineoss.drv/oss.c:1256 error: patch failed: dlls/wineoss.drv/unixlib.h:193 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wineoss.drv/oss.c:1243 error: patch failed: dlls/wineoss.drv/unixlib.h:186 error: patch failed: dlls/wineoss.drv/oss.c:1256 error: patch failed: dlls/wineoss.drv/unixlib.h:193 Task: Patch failed to apply
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Fri, Apr 15, 2022 at 09:40:40PM +0100, Huw Davies wrote:
Technically the lock doesn't need to be taken here since the data is static, however doing so keeps the implementation consistent with the others.
Signed-off-by: Huw Davies huw@codeweavers.com
dlls/wineoss.drv/mmdevdrv.c | 11 +++++------ dlls/wineoss.drv/oss.c | 17 +++++++++++++++++ dlls/wineoss.drv/unixlib.h | 8 ++++++++ 3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index c101d757836..6498a4750d4 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -1427,16 +1427,15 @@ static ULONG WINAPI AudioClock_Release(IAudioClock *iface) static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq) { ACImpl *This = impl_from_IAudioClock(iface);
- struct oss_stream *stream = This->stream;
struct get_frequency_params params;
TRACE("(%p)->(%p)\n", This, freq);
- if(stream->share == AUDCLNT_SHAREMODE_SHARED)
*freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign;
- else
*freq = stream->fmt->nSamplesPerSec;
- params.stream = This->stream;
- params.frequency = freq;
- OSS_CALL(get_frequency, ¶ms);
- return S_OK;
- return params.result;
}
static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index ffea1bb8338..3a512c7cd9e 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1256,6 +1256,22 @@ static NTSTATUS get_next_packet_size(void *args) return oss_unlock_result(stream, ¶ms->result, S_OK); }
+static NTSTATUS get_frequency(void *args) +{
- struct get_frequency_params *params = args;
- struct oss_stream *stream = params->stream;
- UINT64 *freq = params->frequency;
- oss_lock(stream);
- if(stream->share == AUDCLNT_SHAREMODE_SHARED)
*freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign;
- else
*freq = stream->fmt->nSamplesPerSec;
- return oss_unlock_result(stream, ¶ms->result, S_OK);
+}
static NTSTATUS set_event_handle(void *args) { struct set_event_handle_params *params = args; @@ -1296,5 +1312,6 @@ unixlib_entry_t __wine_unix_call_funcs[] = get_latency, get_current_padding, get_next_packet_size,
- get_frequency, set_event_handle,
}; diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index a809ad41d3e..9a544ae7899 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -193,6 +193,13 @@ struct get_next_packet_size_params UINT32 *frames; };
+struct get_frequency_params +{
- struct oss_stream *stream;
- HRESULT result;
- UINT64 *frequency;
+};
struct set_event_handle_params { struct oss_stream *stream; @@ -220,6 +227,7 @@ enum oss_funcs oss_get_latency, oss_get_current_padding, oss_get_next_packet_size,
- oss_get_frequency, oss_set_event_handle,
};
-- 2.25.1