winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2021
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
770 discussions
Start a n
N
ew thread
Rémi Bernon : msvcrt: Set next_token when str is empty in wcstok_s.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 32bbef5d3e6a5b174bdc1343d2d43b161f45fa1b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=32bbef5d3e6a5b174bdc1343…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue May 25 15:59:46 2021 +0200 msvcrt: Set next_token when str is empty in wcstok_s. Otherwise, when str is empty, an invalid parameter exception is raised. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=30244
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/wcs.c | 11 +++++++---- dlls/ucrtbase/tests/string.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 343dec70477..615b4f36a33 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1910,10 +1910,13 @@ wchar_t * CDECL wcstok_s( wchar_t *str, const wchar_t *delim, if (!str) str = *next_token; while (*str && wcschr( delim, *str )) str++; - if (!*str) return NULL; - ret = str++; - while (*str && !wcschr( delim, *str )) str++; - if (*str) *str++ = 0; + if (!*str) ret = NULL; + else + { + ret = str++; + while (*str && !wcschr( delim, *str )) str++; + if (*str) *str++ = 0; + } *next_token = str; return ret; } diff --git a/dlls/ucrtbase/tests/string.c b/dlls/ucrtbase/tests/string.c index 1a4fbbd76f0..9b1d21b801c 100644 --- a/dlls/ucrtbase/tests/string.c +++ b/dlls/ucrtbase/tests/string.c @@ -418,6 +418,24 @@ static void test_wcstok(void) ok(!wcscmp(L"words", token), "expected \"words\", got \"%ls\"\n", token); token = wcstok(NULL, L" ", NULL); ok(!token, "expected NULL, got %p\n", token); + + next = NULL; + wcscpy(buffer, input); + token = wcstok(buffer, L"=", &next); + ok(!wcscmp(token, input), "expected \"%ls\", got \"%ls\"\n", input, token); + ok(next == buffer + wcslen(input), "expected %p, got %p\n", buffer + wcslen(input), next); + token = wcstok(NULL, L"=", &next); + ok(!token, "expected NULL, got \"%ls\"\n", token); + ok(next == buffer + wcslen(input), "expected %p, got %p\n", buffer + wcslen(input), next); + + next = NULL; + wcscpy(buffer, L""); + token = wcstok(buffer, L"=", &next); + ok(token == NULL, "expected NULL, got \"%ls\"\n", token); + ok(next == buffer, "expected %p, got %p\n", buffer, next); + token = wcstok(NULL, L"=", &next); + ok(!token, "expected NULL, got \"%ls\"\n", token); + ok(next == buffer, "expected %p, got %p\n", buffer, next); } static void test__strnicmp(void)
1
0
0
0
Francois Gouget : kernel32/tests: Fix the spelling of an ok() message.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 6c39e731f42dea544461e50dcf1f9a132d135c29 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6c39e731f42dea544461e50d…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue May 25 11:02:27 2021 +0200 kernel32/tests: Fix the spelling of an ok() message. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index beb69352e4d..9b91b6f0998 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -4483,7 +4483,7 @@ static void test_nested_jobs_child(unsigned int index) if (index) { ret = pAssignProcessToJobObject(job_other, GetCurrentProcess()); - ok(!ret, "AssignProcessToJobObject succeded\n"); + ok(!ret, "AssignProcessToJobObject succeeded\n"); ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %u.\n", GetLastError()); }
1
0
0
0
Francois Gouget : ucrtbase/tests: Add the trailing linefeed to an ok() message.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: dc6e90f7f8164b6e9f831a570fb654bd3e9c27e7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dc6e90f7f8164b6e9f831a57…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue May 25 11:02:32 2021 +0200 ucrtbase/tests: Add the trailing linefeed to an ok() message. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ucrtbase/tests/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index aaa8ada2a8a..96dd1acfe54 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -1434,7 +1434,7 @@ static void test_fenv(void) ok(!env._Fe_stat, "env._Fe_stat = %lx\n", env._Fe_stat); ret = fegetenv(&env2); ok(!ret, "fegetenv returned %x\n", ret); - ok(env._Fe_ctl != env2._Fe_ctl, "fesetround didn't change _Fe_ctl (%lx).", env._Fe_ctl); + ok(env._Fe_ctl != env2._Fe_ctl, "fesetround didn't change _Fe_ctl (%lx).\n", env._Fe_ctl); ret = fesetenv(&env); ok(!ret, "fesetenv returned %x\n", ret); ret = fegetround();
1
0
0
0
Jacek Caban : winepulse: Build with msvcrt.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 70f59eb179d6a1c1b4dbc9e0a45b5731cd260793 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=70f59eb179d6a1c1b4dbc9e0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:22:40 2021 +0200 winepulse: Build with msvcrt. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/Makefile.in | 2 ++ dlls/winepulse.drv/mmdevdrv.c | 15 ++------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in index d05d63e92e3..9a04eaee5ee 100644 --- a/dlls/winepulse.drv/Makefile.in +++ b/dlls/winepulse.drv/Makefile.in @@ -3,6 +3,8 @@ IMPORTS = dxguid uuid winmm user32 advapi32 ole32 EXTRALIBS = $(PULSE_LIBS) $(PTHREAD_LIBS) EXTRAINCL = $(PULSE_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin + C_SRCS = \ mmdevdrv.c \ mult.c \ diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 0d55b0fc2d0..bc28bce137e 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -18,25 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION #define COBJMACROS -#define _GNU_SOURCE - -#include "config.h" #include <stdarg.h> -#include <unistd.h> -#include <math.h> -#include <stdio.h> -#include <errno.h> #include "windef.h" #include "winbase.h" -#include "winnls.h" -#include "winreg.h" #include "winternl.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "wine/list.h" #include "ole2.h" @@ -145,7 +134,7 @@ struct ACImpl { AudioSessionWrapper *session_wrapper; }; -static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0}; +static const WCHAR defaultW[] = L"Pulseaudio"; static const IAudioClient3Vtbl AudioClient3_Vtbl; static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; @@ -216,7 +205,7 @@ static char *get_application_name(void) char *str; GetModuleFileNameW(NULL, path, ARRAY_SIZE(path)); - name = strrchrW(path, '\\'); + name = wcsrchr(path, '\\'); if (!name) name = path; else
1
0
0
0
Jacek Caban : winepulse: Allocate ACImpl volumes when channel count is known.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: e19d97ff4e2f5a7800d6df77b8acce95130b84c3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e19d97ff4e2f5a7800d6df77…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:22:33 2021 +0200 winepulse: Allocate ACImpl volumes when channel count is known. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/mmdevdrv.c | 52 ++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index df38bb594c7..0d55b0fc2d0 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -30,8 +30,6 @@ #include <stdio.h> #include <errno.h> -#include <pulse/pulseaudio.h> - #include "windef.h" #include "winbase.h" #include "winnls.h" @@ -134,7 +132,7 @@ struct ACImpl { IUnknown *marshal; IMMDevice *parent; struct list entry; - float vol[PA_CHANNELS_MAX]; + float *vol; LONG ref; EDataFlow dataflow; @@ -293,7 +291,6 @@ int WINAPI AUDDRV_GetPriority(void) HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out) { ACImpl *This; - int i; EDataFlow dataflow; HRESULT hr; @@ -319,8 +316,6 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl; This->dataflow = dataflow; This->parent = dev; - for (i = 0; i < PA_CHANNELS_MAX; ++i) - This->vol[i] = 1.f; hr = CoCreateFreeThreadedMarshaler((IUnknown*)&This->IAudioClient3_iface, &This->marshal); if (hr) { @@ -533,8 +528,10 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, const GUID *sessionguid) { ACImpl *This = impl_from_IAudioClient3(iface); + unsigned int i, channel_count; + struct pulse_stream *stream; char *name; - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags, wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid)); @@ -583,21 +580,40 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, name = get_application_name(); hr = pulse->create_stream(name, This->dataflow, mode, flags, duration, period, fmt, - &This->channel_count, &This->pulse_stream); + &channel_count, &stream); free(name); - if (SUCCEEDED(hr)) { - hr = get_audio_session(sessionguid, This->parent, This->channel_count, &This->session); - if (SUCCEEDED(hr)) { - set_stream_volumes(This); - list_add_tail(&This->session->clients, &This->entry); - } else { - pulse->release_stream(This->pulse_stream, NULL); - This->pulse_stream = NULL; - } + if (FAILED(hr)) + { + pulse->unlock(); + return hr; + } + + if (!(This->vol = malloc(channel_count * sizeof(*This->vol)))) + { + pulse->release_stream(stream, NULL); + pulse->unlock(); + return E_OUTOFMEMORY; + } + for (i = 0; i < channel_count; i++) + This->vol[i] = 1.f; + + hr = get_audio_session(sessionguid, This->parent, channel_count, &This->session); + if (FAILED(hr)) + { + free(This->vol); + This->vol = NULL; + pulse->unlock(); + pulse->release_stream(stream, NULL); + return E_OUTOFMEMORY; } + This->pulse_stream = stream; + This->channel_count = channel_count; + list_add_tail(&This->session->clients, &This->entry); + set_stream_volumes(This); + pulse->unlock(); - return hr; + return S_OK; } static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
1
0
0
0
Jacek Caban : winepulse: Simplify IAudioStreamVolume::GetChannelVolume implementation.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 4432b66e372caf0096df56f45502d7dea1f1800c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4432b66e372caf0096df56f4…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:22:10 2021 +0200 winepulse: Simplify IAudioStreamVolume::GetChannelVolume implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/mmdevdrv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 84ab5b6adec..df38bb594c7 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -1494,21 +1494,21 @@ static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( IAudioStreamVolume *iface, UINT32 index, float *level) { ACImpl *This = impl_from_IAudioStreamVolume(iface); - float volumes[PA_CHANNELS_MAX]; - HRESULT hr; TRACE("(%p)->(%d, %p)\n", This, index, level); if (!level) return E_POINTER; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; if (index >= This->channel_count) return E_INVALIDARG; - hr = AudioStreamVolume_GetAllVolumes(iface, This->channel_count, volumes); - if (SUCCEEDED(hr)) - *level = volumes[index]; - return hr; + pulse->lock(); + *level = This->vol[index]; + pulse->unlock(); + return S_OK; } static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl =
1
0
0
0
Jacek Caban : winepulse: Simplify IAudioStreamVolume::SetChannelVolume implementation.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 6a6296562f536ed10d221f0df43ef30bbd674cb2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6a6296562f536ed10d221f0d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:22:02 2021 +0200 winepulse: Simplify IAudioStreamVolume::SetChannelVolume implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/mmdevdrv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index cac169567ea..84ab5b6adec 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -1472,22 +1472,22 @@ static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( IAudioStreamVolume *iface, UINT32 index, float level) { ACImpl *This = impl_from_IAudioStreamVolume(iface); - HRESULT hr; - float volumes[PA_CHANNELS_MAX]; TRACE("(%p)->(%d, %f)\n", This, index, level); if (level < 0.f || level > 1.f) return E_INVALIDARG; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; if (index >= This->channel_count) return E_INVALIDARG; - hr = AudioStreamVolume_GetAllVolumes(iface, This->channel_count, volumes); - volumes[index] = level; - if (SUCCEEDED(hr)) - hr = AudioStreamVolume_SetAllVolumes(iface, This->channel_count, volumes); - return hr; + pulse->lock(); + This->vol[index] = level; + set_stream_volumes(This); + pulse->unlock(); + return S_OK; } static HRESULT WINAPI AudioStreamVolume_GetChannelVolume(
1
0
0
0
Jacek Caban : winepulse: Move pulse_is_started to unix lib.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: aba40bd50a065b3ac913dbc1263c38535fb5d9e7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aba40bd50a065b3ac913dbc1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:21:56 2021 +0200 winepulse: Move pulse_is_started to unix lib. And move pulse_stream to pulse.c since it's accessed only from unix lib now. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/mmdevdrv.c | 2 +- dlls/winepulse.drv/pulse.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/winepulse.drv/unixlib.h | 32 +++----------------------------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 8e717f9d18f..cac169567ea 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -1611,7 +1611,7 @@ static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface, goto out; } LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) { - if (client->pulse_stream->started) { + if (client->pulse_stream && pulse->is_started(client->pulse_stream)) { *state = AudioSessionStateActive; goto out; } diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 063c92605b6..05e1dacd68e 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -43,6 +43,36 @@ WINE_DEFAULT_DEBUG_CHANNEL(pulse); +struct pulse_stream +{ + EDataFlow dataflow; + + pa_stream *stream; + pa_sample_spec ss; + pa_channel_map map; + pa_buffer_attr attr; + + DWORD flags; + AUDCLNT_SHAREMODE share; + HANDLE event; + float vol[PA_CHANNELS_MAX]; + BOOL mute; + + INT32 locked; + UINT32 bufsize_frames, real_bufsize_bytes, period_bytes; + UINT32 started, peek_ofs, read_offs_bytes, lcl_offs_bytes, pa_offs_bytes; + UINT32 tmp_buffer_bytes, held_bytes, peek_len, peek_buffer_len, pa_held_bytes; + BYTE *local_buffer, *tmp_buffer, *peek_buffer; + void *locked_ptr; + BOOL please_quit, just_started, just_underran; + pa_usec_t last_time, mmdev_period_usec; + + INT64 clock_lastpos, clock_written; + + struct list packet_free_head; + struct list packet_filled_head; +}; + typedef struct _ACPacket { struct list entry; @@ -1770,6 +1800,11 @@ static HRESULT WINAPI pulse_set_event_handle(struct pulse_stream *stream, HANDLE return hr; } +static BOOL WINAPI pulse_is_started(struct pulse_stream *stream) +{ + return pulse_stream_valid(stream) && stream->started; +} + static const struct unix_funcs unix_funcs = { pulse_lock, @@ -1795,6 +1830,7 @@ static const struct unix_funcs unix_funcs = pulse_set_volumes, pulse_set_event_handle, pulse_test_connect, + pulse_is_started, }; NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out) diff --git a/dlls/winepulse.drv/unixlib.h b/dlls/winepulse.drv/unixlib.h index f1546d42d76..13793c734cd 100644 --- a/dlls/winepulse.drv/unixlib.h +++ b/dlls/winepulse.drv/unixlib.h @@ -18,6 +18,8 @@ #include "wine/list.h" +struct pulse_stream; + struct pulse_config { struct @@ -29,35 +31,6 @@ struct pulse_config unsigned int speakers_mask; }; -struct pulse_stream -{ - EDataFlow dataflow; - - pa_stream *stream; - pa_sample_spec ss; - pa_channel_map map; - pa_buffer_attr attr; - - DWORD flags; - AUDCLNT_SHAREMODE share; - HANDLE event; - float vol[PA_CHANNELS_MAX]; - - INT32 locked; - UINT32 bufsize_frames, real_bufsize_bytes, period_bytes; - UINT32 started, peek_ofs, read_offs_bytes, lcl_offs_bytes, pa_offs_bytes; - UINT32 tmp_buffer_bytes, held_bytes, peek_len, peek_buffer_len, pa_held_bytes; - BYTE *local_buffer, *tmp_buffer, *peek_buffer; - void *locked_ptr; - BOOL please_quit, just_started, just_underran; - pa_usec_t last_time, mmdev_period_usec; - - INT64 clock_lastpos, clock_written; - - struct list packet_free_head; - struct list packet_filled_head; -}; - struct unix_funcs { void (WINAPI *lock)(void); @@ -89,4 +62,5 @@ struct unix_funcs const float *volumes, const float *session_volumes); HRESULT (WINAPI *set_event_handle)(struct pulse_stream *stream, HANDLE event); HRESULT (WINAPI *test_connect)(const char *name, struct pulse_config *config); + BOOL (WINAPI *is_started)(struct pulse_stream *stream); };
1
0
0
0
Jacek Caban : winepulse: Simplify checks for stream being initialized.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: bf74f36350c92daae84623dc0bd0530c212bb908 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bf74f36350c92daae84623dc…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:21:52 2021 +0200 winepulse: Simplify checks for stream being initialized. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/mmdevdrv.c | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 0178cdb9e7b..8e717f9d18f 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -230,14 +230,6 @@ static char *get_application_name(void) return str; } -static HRESULT pulse_stream_valid(ACImpl *This) { - if (!This->pulse_stream) - return AUDCLNT_E_NOT_INITIALIZED; - if (pa_stream_get_state(This->pulse_stream->stream) != PA_STREAM_READY) - return AUDCLNT_E_DEVICE_INVALIDATED; - return S_OK; -} - static DWORD WINAPI pulse_timer_cb(void *user) { ACImpl *This = user; @@ -905,7 +897,6 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, void **ppv) { ACImpl *This = impl_from_IAudioClient3(iface); - HRESULT hr; TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); @@ -913,11 +904,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, return E_POINTER; *ppv = NULL; - pulse->lock(); - hr = pulse_stream_valid(This); - pulse->unlock(); - if (FAILED(hr)) - return hr; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; if (IsEqualIID(riid, &IID_IAudioRenderClient)) { if (This->dataflow != eRender) @@ -1436,7 +1424,6 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( IAudioStreamVolume *iface, UINT32 count, const float *levels) { ACImpl *This = impl_from_IAudioStreamVolume(iface); - HRESULT hr; int i; TRACE("(%p)->(%d, %p)\n", This, count, levels); @@ -1444,28 +1431,24 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( if (!levels) return E_POINTER; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; if (count != This->channel_count) return E_INVALIDARG; pulse->lock(); - hr = pulse_stream_valid(This); - if (FAILED(hr)) - goto out; - for (i = 0; i < count; ++i) This->vol[i] = levels[i]; set_stream_volumes(This); -out: pulse->unlock(); - return hr; + return S_OK; } static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( IAudioStreamVolume *iface, UINT32 count, float *levels) { ACImpl *This = impl_from_IAudioStreamVolume(iface); - HRESULT hr; int i; TRACE("(%p)->(%d, %p)\n", This, count, levels); @@ -1473,20 +1456,16 @@ static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( if (!levels) return E_POINTER; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; if (count != This->channel_count) return E_INVALIDARG; pulse->lock(); - hr = pulse_stream_valid(This); - if (FAILED(hr)) - goto out; - for (i = 0; i < count; ++i) levels[i] = This->vol[i]; - -out: pulse->unlock(); - return hr; + return S_OK; } static HRESULT WINAPI AudioStreamVolume_SetChannelVolume(
1
0
0
0
Jacek Caban : winepulse: Move pulse_get_position to unix lib.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 1518e73b23211af738ae448a80466c0199f24419 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1518e73b23211af738ae448a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 24 18:21:49 2021 +0200 winepulse: Move pulse_get_position to unix lib. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winepulse.drv/mmdevdrv.c | 46 +++++++++++-------------------------------- dlls/winepulse.drv/pulse.c | 34 ++++++++++++++++++++++++++++++++ dlls/winepulse.drv/unixlib.h | 1 + 3 files changed, 47 insertions(+), 34 deletions(-) diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 1fe0d0bd50e..0178cdb9e7b 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -1296,42 +1296,15 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, UINT64 *qpctime) { ACImpl *This = impl_from_IAudioClock(iface); - HRESULT hr; TRACE("(%p)->(%p, %p)\n", This, pos, qpctime); if (!pos) return E_POINTER; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; - pulse->lock(); - hr = pulse_stream_valid(This); - if (FAILED(hr)) { - pulse->unlock(); - return hr; - } - - *pos = This->pulse_stream->clock_written - This->pulse_stream->held_bytes; - - if (This->pulse_stream->share == AUDCLNT_SHAREMODE_EXCLUSIVE) - *pos /= pa_frame_size(&This->pulse_stream->ss); - - /* Make time never go backwards */ - if (*pos < This->pulse_stream->clock_lastpos) - *pos = This->pulse_stream->clock_lastpos; - else - This->pulse_stream->clock_lastpos = *pos; - pulse->unlock(); - - TRACE("%p Position: %u\n", This, (unsigned)*pos); - - if (qpctime) { - LARGE_INTEGER stamp, freq; - QueryPerformanceCounter(&stamp); - QueryPerformanceFrequency(&freq); - *qpctime = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart; - } - - return S_OK; + return pulse->get_position(This->pulse_stream, FALSE, pos, qpctime); } static HRESULT WINAPI AudioClock_GetCharacteristics(IAudioClock *iface, @@ -1382,10 +1355,15 @@ static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface, UINT64 *pos, UINT64 *qpctime) { ACImpl *This = impl_from_IAudioClock2(iface); - HRESULT hr = AudioClock_GetPosition(&This->IAudioClock_iface, pos, qpctime); - if (SUCCEEDED(hr) && This->pulse_stream->share == AUDCLNT_SHAREMODE_SHARED) - *pos /= pa_frame_size(&This->pulse_stream->ss); - return hr; + + TRACE("(%p)->(%p, %p)\n", This, pos, qpctime); + + if (!pos) + return E_POINTER; + if (!This->pulse_stream) + return AUDCLNT_E_NOT_INITIALIZED; + + return pulse->get_position(This->pulse_stream, TRUE, pos, qpctime); } static const IAudioClock2Vtbl AudioClock2_Vtbl = diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index b9dceb911d0..063c92605b6 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -1710,6 +1710,39 @@ static HRESULT WINAPI pulse_get_frequency(struct pulse_stream *stream, UINT64 *f return S_OK; } +static HRESULT WINAPI pulse_get_position(struct pulse_stream *stream, BOOL device, UINT64 *pos, UINT64 *qpctime) +{ + pulse_lock(); + if (!pulse_stream_valid(stream)) + { + pulse_unlock(); + return AUDCLNT_E_DEVICE_INVALIDATED; + } + + *pos = stream->clock_written - stream->held_bytes; + + if (stream->share == AUDCLNT_SHAREMODE_EXCLUSIVE || device) + *pos /= pa_frame_size(&stream->ss); + + /* Make time never go backwards */ + if (*pos < stream->clock_lastpos) + *pos = stream->clock_lastpos; + else + stream->clock_lastpos = *pos; + pulse_unlock(); + + TRACE("%p Position: %u\n", stream, (unsigned)*pos); + + if (qpctime) + { + LARGE_INTEGER stamp, freq; + NtQueryPerformanceCounter(&stamp, &freq); + *qpctime = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart; + } + + return S_OK; +} + static void WINAPI pulse_set_volumes(struct pulse_stream *stream, float master_volume, const float *volumes, const float *session_volumes) { @@ -1758,6 +1791,7 @@ static const struct unix_funcs unix_funcs = pulse_get_current_padding, pulse_get_next_packet_size, pulse_get_frequency, + pulse_get_position, pulse_set_volumes, pulse_set_event_handle, pulse_test_connect, diff --git a/dlls/winepulse.drv/unixlib.h b/dlls/winepulse.drv/unixlib.h index d9c6ef057bb..f1546d42d76 100644 --- a/dlls/winepulse.drv/unixlib.h +++ b/dlls/winepulse.drv/unixlib.h @@ -84,6 +84,7 @@ struct unix_funcs HRESULT (WINAPI *get_current_padding)(struct pulse_stream *stream, UINT32 *out); HRESULT (WINAPI *get_next_packet_size)(struct pulse_stream *stream, UINT32 *frames); HRESULT (WINAPI *get_frequency)(struct pulse_stream *stream, UINT64 *freq); + HRESULT (WINAPI *get_position)(struct pulse_stream *stream, BOOL device, UINT64 *pos, UINT64 *qpctime); void (WINAPI *set_volumes)(struct pulse_stream *stream, float master_volume, const float *volumes, const float *session_volumes); HRESULT (WINAPI *set_event_handle)(struct pulse_stream *stream, HANDLE event);
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200