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
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
September 2023
----- 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
1 participants
920 discussions
Start a n
N
ew thread
Rémi Bernon : dmime: Get rid of IDirectMusicPerformance8Impl typedef.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: c927967a7623921b8f2eaa946b72342d4ec81b5d URL:
https://gitlab.winehq.org/wine/wine/-/commit/c927967a7623921b8f2eaa946b7234…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 4 21:45:31 2023 +0200 dmime: Get rid of IDirectMusicPerformance8Impl typedef. --- dlls/dmime/performance.c | 125 ++++++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 62 deletions(-)
1
0
0
0
Rémi Bernon : dmime: Rename IDirectMusicPerformance8Impl method prefix to performance.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 52f7ae49326e97fd197521df5f296d3be7c90f25 URL:
https://gitlab.winehq.org/wine/wine/-/commit/52f7ae49326e97fd197521df5f296d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 4 21:37:26 2023 +0200 dmime: Rename IDirectMusicPerformance8Impl method prefix to performance. --- dlls/dmime/performance.c | 286 +++++++++++++++++++++-------------------------- 1 file changed, 129 insertions(+), 157 deletions(-)
1
0
0
0
Rémi Bernon : dmime: Fix indentation in DirectMusicPerformance class constructor.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 698605ce41616a7777100a75fefaeba62eed8354 URL:
https://gitlab.winehq.org/wine/wine/-/commit/698605ce41616a7777100a75fefaeb…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 4 21:36:44 2023 +0200 dmime: Fix indentation in DirectMusicPerformance class constructor. --- dlls/dmime/performance.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index f6eb53e365f..cd3d800e267 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -1275,24 +1275,28 @@ static const IDirectMusicPerformance8Vtbl DirectMusicPerformance8_Vtbl = { }; /* for ClassFactory */ -HRESULT create_dmperformance(REFIID lpcGUID, void **ppobj) +HRESULT create_dmperformance(REFIID iid, void **ret_iface) { - IDirectMusicPerformance8Impl *obj; + IDirectMusicPerformance8Impl *obj; + HRESULT hr; - TRACE("(%s, %p)\n", debugstr_guid(lpcGUID), ppobj); + TRACE("(%s, %p)\n", debugstr_guid(iid), ret_iface); - *ppobj = NULL; + *ret_iface = NULL; if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; - obj->IDirectMusicPerformance8_iface.lpVtbl = &DirectMusicPerformance8_Vtbl; - obj->ref = 0; /* will be inited by QueryInterface */ - obj->pDefaultPath = NULL; - InitializeCriticalSection(&obj->safe); - obj->safe.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectMusicPerformance8Impl*->safe"); - wine_rb_init(&obj->pchannels, pchannel_block_compare); - - obj->rtLatencyTime = 100; /* 100 ms TO FIX */ - obj->dwBumperLength = 50; /* 50 ms default */ - obj->dwPrepareTime = 1000; /* 1000 ms default */ - return IDirectMusicPerformance8Impl_QueryInterface(&obj->IDirectMusicPerformance8_iface, - lpcGUID, ppobj); + obj->IDirectMusicPerformance8_iface.lpVtbl = &DirectMusicPerformance8_Vtbl; + obj->ref = 1; + + obj->pDefaultPath = NULL; + InitializeCriticalSection(&obj->safe); + obj->safe.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectMusicPerformance8Impl*->safe"); + wine_rb_init(&obj->pchannels, pchannel_block_compare); + + obj->rtLatencyTime = 100; /* 100 ms TO FIX */ + obj->dwBumperLength = 50; /* 50 ms default */ + obj->dwPrepareTime = 1000; /* 1000 ms default */ + + hr = IDirectMusicPerformance8_QueryInterface(&obj->IDirectMusicPerformance8_iface, iid, ret_iface); + IDirectMusicPerformance_Release(&obj->IDirectMusicPerformance8_iface); + return hr; }
1
0
0
0
Rémi Bernon : dmime: Use the correct interface methods.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 2dc15d394374ac2a29c482d8e74994ab903bd849 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2dc15d394374ac2a29c482d8e74994…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 4 13:19:25 2023 +0200 dmime: Use the correct interface methods. --- dlls/dmime/graph.c | 4 ++-- dlls/dmime/performance.c | 2 +- dlls/dmime/tests/dmime.c | 8 ++++---- dlls/dmime/tests/performance.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/dmime/graph.c b/dlls/dmime/graph.c index 8ac037e43bc..159923b6a70 100644 --- a/dlls/dmime/graph.c +++ b/dlls/dmime/graph.c @@ -129,8 +129,8 @@ static HRESULT WINAPI DirectMusicGraph_InsertTool(IDirectMusicGraph *iface, IDir pNewTool = calloc(1, sizeof(*pNewTool)); pNewTool->pTool = pTool; pNewTool->dwIndex = lIndex; - IDirectMusicTool8_AddRef(pTool); - IDirectMusicTool8_Init(pTool, iface); + IDirectMusicTool_AddRef(pTool); + IDirectMusicTool_Init(pTool, iface); list_add_tail (pPrevEntry->next, &pNewTool->entry); #if 0 diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index a1acc6d97cc..f6eb53e365f 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -879,7 +879,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_CloseDown(IDirectMusicPerform This->dsound = NULL; } if (This->dmusic) { - IDirectMusic_SetDirectSound(This->dmusic, NULL, NULL); + IDirectMusic8_SetDirectSound(This->dmusic, NULL, NULL); IDirectMusic8_Release(This->dmusic); This->dmusic = NULL; } diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index f00b5073b48..e95a1c02427 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -223,7 +223,7 @@ static BOOL missing_dmime(void) if (hr == S_OK && dms) { - IDirectMusicSegment_Release(dms); + IDirectMusicSegment8_Release(dms); return FALSE; } return TRUE; @@ -1015,7 +1015,7 @@ static void expect_getparam(IDirectMusicTrack *track, REFGUID type, const char * HRESULT hr; char buf[64] = { 0 }; - hr = IDirectMusicTrack8_GetParam(track, type, 0, NULL, buf); + hr = IDirectMusicTrack_GetParam(track, type, 0, NULL, buf); ok(hr == expect, "GetParam(%s) failed: %#lx, expected %#lx\n", name, hr, expect); } @@ -1025,7 +1025,7 @@ static void expect_setparam(IDirectMusicTrack *track, REFGUID type, const char * HRESULT hr; char buf[64] = { 0 }; - hr = IDirectMusicTrack8_SetParam(track, type, 0, buf); + hr = IDirectMusicTrack_SetParam(track, type, 0, buf); ok(hr == expect, "SetParam(%s) failed: %#lx, expected %#lx\n", name, hr, expect); } @@ -1103,7 +1103,7 @@ static void test_track(void) /* IDirectMusicTrack */ if (class[i].has_params != ~0) { for (j = 0; j < ARRAY_SIZE(param_types); j++) { - hr = IDirectMusicTrack8_IsParamSupported(dmt, param_types[j].type); + hr = IDirectMusicTrack_IsParamSupported(dmt, param_types[j].type); if (class[i].has_params & (1 << j)) { ok(hr == S_OK, "IsParamSupported(%s) failed: %#lx, expected S_OK\n", param_types[j].name, hr); diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c index 100d8e40be0..4af91fc3130 100644 --- a/dlls/dmime/tests/performance.c +++ b/dlls/dmime/tests/performance.c @@ -334,7 +334,7 @@ static void test_createport(void) ok(hr == S_OK, "CloseDown failed: %#lx\n", hr); IDirectMusic_Release(music); - IDirectMusicPerformance_Release(perf); + IDirectMusicPerformance8_Release(perf); } static void test_pchannel(void)
1
0
0
0
Rémi Bernon : dmime: Use CRT allocation functions.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 0feb0cda7498c7fd1c658782eb9ff1f2966204a5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0feb0cda7498c7fd1c658782eb9ff1…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 4 21:29:38 2023 +0200 dmime: Use CRT allocation functions. --- dlls/dmime/audiopath.c | 9 +++------ dlls/dmime/dmobject.c | 8 +++----- dlls/dmime/graph.c | 11 +++-------- dlls/dmime/lyricstrack.c | 9 +++------ dlls/dmime/markertrack.c | 9 +++------ dlls/dmime/paramcontroltrack.c | 9 +++------ dlls/dmime/performance.c | 28 ++++++++++------------------ dlls/dmime/segment.c | 18 +++++++++--------- dlls/dmime/segmentstate.c | 9 ++------- dlls/dmime/segtriggertrack.c | 18 ++++++------------ dlls/dmime/seqtrack.c | 9 +++------ dlls/dmime/sysextrack.c | 9 +++------ dlls/dmime/tempotrack.c | 19 ++++++------------- dlls/dmime/timesigtrack.c | 12 ++++-------- dlls/dmime/wavetrack.c | 24 +++++++++--------------- 15 files changed, 70 insertions(+), 131 deletions(-)
1
0
0
0
Rémi Bernon : dmime: Always return S_FALSE from DllCanUnloadNow.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 6e1e7a88fd5d50dd9852ae6106ddedf5506311bc URL:
https://gitlab.winehq.org/wine/wine/-/commit/6e1e7a88fd5d50dd9852ae6106dded…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Aug 22 17:40:22 2023 +0200 dmime: Always return S_FALSE from DllCanUnloadNow. --- dlls/dmime/audiopath.c | 2 -- dlls/dmime/dmime_main.c | 22 ---------------------- dlls/dmime/dmime_private.h | 7 ------- dlls/dmime/graph.c | 2 -- dlls/dmime/lyricstrack.c | 2 -- dlls/dmime/markertrack.c | 2 -- dlls/dmime/paramcontroltrack.c | 2 -- dlls/dmime/performance.c | 4 ---- dlls/dmime/segment.c | 3 --- dlls/dmime/segmentstate.c | 4 ---- dlls/dmime/segtriggertrack.c | 2 -- dlls/dmime/seqtrack.c | 2 -- dlls/dmime/sysextrack.c | 2 -- dlls/dmime/tempotrack.c | 2 -- dlls/dmime/timesigtrack.c | 2 -- dlls/dmime/wavetrack.c | 2 -- 16 files changed, 62 deletions(-)
1
0
0
0
Rémi Bernon : dmusic: Stop leaking instruments on collection release.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 4ae866a0a7f65a4a4d2c95c5c98145b02d63528e URL:
https://gitlab.winehq.org/wine/wine/-/commit/4ae866a0a7f65a4a4d2c95c5c98145…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Sep 9 14:51:56 2023 +0200 dmusic: Stop leaking instruments on collection release. --- dlls/dmusic/collection.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index 0b4e23b34f4..2d4a7f855ae 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -98,7 +98,18 @@ static ULONG WINAPI collection_Release(IDirectMusicCollection *iface) TRACE("(%p): new ref = %lu\n", iface, ref); - if (!ref) { + if (!ref) + { + struct instrument_entry *instrument_entry; + void *next; + + LIST_FOR_EACH_ENTRY_SAFE(instrument_entry, next, &This->instruments, struct instrument_entry, entry) + { + list_remove(&instrument_entry->entry); + IDirectMusicInstrument_Release(instrument_entry->instrument); + free(instrument_entry); + } + free(This); }
1
0
0
0
Rémi Bernon : dmusic: Cleanup collection instrument iteration loops.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 572125edf622d1cf00025e47a2f487ef42b6bb15 URL:
https://gitlab.winehq.org/wine/wine/-/commit/572125edf622d1cf00025e47a2f487…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Sep 9 13:27:36 2023 +0200 dmusic: Cleanup collection instrument iteration loops. --- dlls/dmusic/collection.c | 83 ++++++++++++++++++++++---------------------- dlls/dmusic/dmusic_private.h | 5 --- 2 files changed, 41 insertions(+), 47 deletions(-) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index cca23870f9d..0b4e23b34f4 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -24,6 +24,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); WINE_DECLARE_DEBUG_CHANNEL(dmfile); +struct instrument_entry +{ + struct list entry; + IDirectMusicInstrument *instrument; +}; + struct collection { IDirectMusicCollection IDirectMusicCollection_iface; @@ -36,8 +42,8 @@ struct collection /* pool table */ POOLTABLE *pPoolTable; POOLCUE *pPoolCues; - /* instruments */ - struct list Instruments; + + struct list instruments; }; static inline struct collection *impl_from_IDirectMusicCollection(IDirectMusicCollection *iface) @@ -103,25 +109,25 @@ static HRESULT WINAPI collection_GetInstrument(IDirectMusicCollection *iface, DWORD patch, IDirectMusicInstrument **instrument) { struct collection *This = impl_from_IDirectMusicCollection(iface); - DMUS_PRIVATE_INSTRUMENTENTRY *inst_entry; - struct list *list_entry; + struct instrument_entry *entry; DWORD inst_patch; + HRESULT hr; TRACE("(%p, %lu, %p)\n", iface, patch, instrument); - LIST_FOR_EACH(list_entry, &This->Instruments) { - inst_entry = LIST_ENTRY(list_entry, DMUS_PRIVATE_INSTRUMENTENTRY, entry); - IDirectMusicInstrument_GetPatch(inst_entry->pInstrument, &inst_patch); - if (patch == inst_patch) { - *instrument = inst_entry->pInstrument; - IDirectMusicInstrument_AddRef(inst_entry->pInstrument); - TRACE(": returning instrument %p\n", *instrument); + LIST_FOR_EACH_ENTRY(entry, &This->instruments, struct instrument_entry, entry) + { + if (FAILED(hr = IDirectMusicInstrument_GetPatch(entry->instrument, &inst_patch))) return hr; + if (patch == inst_patch) + { + *instrument = entry->instrument; + IDirectMusicInstrument_AddRef(entry->instrument); + TRACE(": returning instrument %p\n", entry->instrument); return S_OK; } } TRACE(": instrument not found\n"); - return DMUS_E_INVALIDPATCH; } @@ -129,26 +135,23 @@ static HRESULT WINAPI collection_EnumInstrument(IDirectMusicCollection *iface, DWORD index, DWORD *patch, LPWSTR name, DWORD name_length) { struct collection *This = impl_from_IDirectMusicCollection(iface); - DWORD i = 0; - DMUS_PRIVATE_INSTRUMENTENTRY *inst_entry; - struct list *list_entry; - DWORD length; + struct instrument_entry *entry; + HRESULT hr; TRACE("(%p, %ld, %p, %p, %ld)\n", iface, index, patch, name, name_length); - LIST_FOR_EACH(list_entry, &This->Instruments) { - inst_entry = LIST_ENTRY(list_entry, DMUS_PRIVATE_INSTRUMENTENTRY, entry); - if (i == index) { - struct instrument *instrument = impl_from_IDirectMusicInstrument(inst_entry->pInstrument); - IDirectMusicInstrument_GetPatch(inst_entry->pInstrument, patch); - if (name) { - length = min(lstrlenW(instrument->wszName), name_length - 1); - memcpy(name, instrument->wszName, length * sizeof(WCHAR)); - name[length] = '\0'; - } - return S_OK; + LIST_FOR_EACH_ENTRY(entry, &This->instruments, struct instrument_entry, entry) + { + if (index--) continue; + if (FAILED(hr = IDirectMusicInstrument_GetPatch(entry->instrument, patch))) return hr; + if (name) + { + struct instrument *instrument = impl_from_IDirectMusicInstrument(entry->instrument); + DWORD length = min(lstrlenW(instrument->wszName), name_length - 1); + memcpy(name, instrument->wszName, length * sizeof(WCHAR)); + name[length] = '\0'; } - i++; + return S_OK; } return S_FALSE; @@ -372,12 +375,12 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface, ListCount[1] = 0; switch (chunk.fccID) { case FOURCC_INS: { - DMUS_PRIVATE_INSTRUMENTENTRY *entry = calloc(1, sizeof(DMUS_PRIVATE_INSTRUMENTENTRY)); + struct instrument_entry *entry = calloc(1, sizeof(*entry)); TRACE_(dmfile)(": instrument list\n"); liMove.QuadPart = -12; IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - if (FAILED(instrument_create_from_stream(stream, &entry->pInstrument))) free(entry); - else list_add_tail(&This->Instruments, &entry->entry); + if (FAILED(instrument_create_from_stream(stream, &entry->instrument))) free(entry); + else list_add_tail(&This->instruments, &entry->entry); break; } } @@ -417,10 +420,10 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface, /* DEBUG: dumps whole collection object tree: */ - if (TRACE_ON(dmusic)) { - int r = 0; - DMUS_PRIVATE_INSTRUMENTENTRY *tmpEntry; - struct list *listEntry; + if (TRACE_ON(dmusic)) + { + struct instrument_entry *entry; + int i = 0; TRACE("*** IDirectMusicCollection (%p) ***\n", &This->IDirectMusicCollection_iface); dump_DMUS_OBJECTDESC(&This->dmobj.desc); @@ -429,11 +432,8 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface, TRACE(" - cInstruments: %ld\n", This->pHeader->cInstruments); TRACE(" - Instruments:\n"); - LIST_FOR_EACH(listEntry, &This->Instruments) { - tmpEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_INSTRUMENTENTRY, entry ); - TRACE(" - Instrument[%i]: %p\n", r, tmpEntry->pInstrument); - r++; - } + LIST_FOR_EACH_ENTRY(entry, &This->instruments, struct instrument_entry, entry) + TRACE(" - Instrument[%i]: %p\n", i++, entry->instrument); } return S_OK; @@ -463,8 +463,7 @@ HRESULT collection_create(IUnknown **ret_iface) (IUnknown *)&collection->IDirectMusicCollection_iface); collection->dmobj.IDirectMusicObject_iface.lpVtbl = &collection_object_vtbl; collection->dmobj.IPersistStream_iface.lpVtbl = &collection_stream_vtbl; - - list_init(&collection->Instruments); + list_init(&collection->instruments); TRACE("Created DirectMusicCollection %p\n", collection); *ret_iface = (IUnknown *)&collection->IDirectMusicCollection_iface; diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 387c787fd2e..2ae47217ddf 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -161,11 +161,6 @@ struct IReferenceClockImpl { DMUS_CLOCKINFO pClockInfo; }; -typedef struct _DMUS_PRIVATE_INSTRUMENT_ENTRY { - struct list entry; /* for listing elements */ - IDirectMusicInstrument* pInstrument; -} DMUS_PRIVATE_INSTRUMENTENTRY, *LPDMUS_PRIVATE_INSTRUMENTENTRY; - typedef struct _DMUS_PRIVATE_POOLCUE { struct list entry; /* for listing elements */ } DMUS_PRIVATE_POOLCUE, *LPDMUS_PRIVATE_POOLCUE;
1
0
0
0
Rémi Bernon : dmusic: Allocate and parse instruments in a single pass.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: ff4cb785cbb4f9a5ab2fc16293edc7ea9fb097fc URL:
https://gitlab.winehq.org/wine/wine/-/commit/ff4cb785cbb4f9a5ab2fc16293edc7…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 7 10:12:29 2023 +0200 dmusic: Allocate and parse instruments in a single pass. --- dlls/dmusic/collection.c | 68 ++++---------------------------------------- dlls/dmusic/dmusic_private.h | 7 +---- dlls/dmusic/instrument.c | 46 +++++++++++++++++++----------- 3 files changed, 35 insertions(+), 86 deletions(-)
1
0
0
0
Rémi Bernon : dmusic: Rewrite instrument ins chunk parsing.
by Alexandre Julliard
11 Sep '23
11 Sep '23
Module: wine Branch: master Commit: 01127ce4746d3960241a05db53e73f92d828e3ef URL:
https://gitlab.winehq.org/wine/wine/-/commit/01127ce4746d3960241a05db53e73f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Aug 31 21:58:49 2023 +0200 dmusic: Rewrite instrument ins chunk parsing. --- dlls/dmusic/instrument.c | 163 +++++++++++++---------------------------------- 1 file changed, 45 insertions(+), 118 deletions(-) diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index 1e171048008..cbcebcb5902 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -151,47 +151,6 @@ HRESULT instrument_create(IDirectMusicInstrument **ret_iface) return S_OK; } -static HRESULT read_from_stream(IStream *stream, void *data, ULONG size) -{ - ULONG bytes_read; - HRESULT hr; - - hr = IStream_Read(stream, data, size, &bytes_read); - if(FAILED(hr)){ - TRACE("IStream_Read failed: %08lx\n", hr); - return hr; - } - if (bytes_read < size) { - TRACE("Didn't read full chunk: %lu < %lu\n", bytes_read, size); - return E_FAIL; - } - - return S_OK; -} - -static inline DWORD subtract_bytes(DWORD len, DWORD bytes) -{ - if(bytes > len){ - TRACE("Apparent mismatch in chunk lengths? %lu bytes remaining, %lu bytes read\n", len, bytes); - return 0; - } - return len - bytes; -} - -static inline HRESULT advance_stream(IStream *stream, ULONG bytes) -{ - LARGE_INTEGER move; - HRESULT ret; - - move.QuadPart = bytes; - - ret = IStream_Seek(stream, move, STREAM_SEEK_CUR, NULL); - if (FAILED(ret)) - WARN("IStream_Seek failed: %08lx\n", ret); - - return ret; -} - static HRESULT parse_art1_chunk(struct instrument *This, IStream *stream, struct chunk_entry *chunk) { struct articulation *articulation; @@ -308,13 +267,45 @@ static HRESULT parse_lrgn_list(struct instrument *This, IStream *stream, struct return hr; } +static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct chunk_entry *parent) +{ + struct chunk_entry chunk = {.parent = parent}; + HRESULT hr; + + while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) + { + switch (MAKE_IDTYPE(chunk.id, chunk.type)) + { + case FOURCC_INSH: + case FOURCC_DLID: + /* Instrument header and id are already set so just skip */ + break; + + case MAKE_IDTYPE(FOURCC_LIST, FOURCC_LRGN): + hr = parse_lrgn_list(This, stream, &chunk); + break; + + case MAKE_IDTYPE(FOURCC_LIST, FOURCC_LART): + hr = parse_lart_list(This, stream, &chunk); + break; + + default: + FIXME("Ignoring chunk %s %s\n", debugstr_fourcc(chunk.id), debugstr_fourcc(chunk.type)); + break; + } + + if (FAILED(hr)) break; + } + + return hr; +} + /* Function that loads all instrument data and which is called from IDirectMusicCollection_GetInstrument as in native */ HRESULT instrument_load(IDirectMusicInstrument *iface, IStream *stream) { struct instrument *This = impl_from_IDirectMusicInstrument(iface); + struct chunk_entry chunk = {0}; HRESULT hr; - DMUS_PRIVATE_CHUNK chunk; - ULONG length = This->length; TRACE("(%p, %p): offset = 0x%s, length = %lu)\n", This, stream, wine_dbgstr_longlong(This->liInstrumentPosition.QuadPart), This->length); @@ -328,90 +319,26 @@ HRESULT instrument_load(IDirectMusicInstrument *iface, IStream *stream) return DMUS_E_UNSUPPORTED_STREAM; } - while (length) + if ((hr = stream_next_chunk(stream, &chunk)) == S_OK) { - hr = read_from_stream(stream, &chunk, sizeof(chunk)); - if (FAILED(hr)) - goto error; - - length = subtract_bytes(length, sizeof(chunk) + chunk.dwSize); - - switch (chunk.fccID) + switch (MAKE_IDTYPE(chunk.id, chunk.type)) { - case FOURCC_INSH: - case FOURCC_DLID: - TRACE("Chunk %s: %lu bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize); - - /* Instrument header and id are already set so just skip */ - hr = advance_stream(stream, chunk.dwSize); - if (FAILED(hr)) - goto error; - - break; - - case FOURCC_LIST: { - DWORD size = chunk.dwSize; - - TRACE("LIST chunk: %lu bytes\n", chunk.dwSize); - - hr = read_from_stream(stream, &chunk.fccID, sizeof(chunk.fccID)); - if (FAILED(hr)) - goto error; - - size = subtract_bytes(size, sizeof(chunk.fccID)); - - switch (chunk.fccID) - { - case FOURCC_LRGN: - { - static const LARGE_INTEGER zero = {0}; - struct chunk_entry list_chunk = {.id = FOURCC_LIST, .size = chunk.dwSize, .type = chunk.fccID}; - TRACE("LRGN chunk (regions list): %lu bytes\n", size); - IStream_Seek(stream, zero, STREAM_SEEK_CUR, &list_chunk.offset); - list_chunk.offset.QuadPart -= 12; - hr = parse_lrgn_list(This, stream, &list_chunk); - break; - } - - case FOURCC_LART: - { - static const LARGE_INTEGER zero = {0}; - struct chunk_entry list_chunk = {.id = FOURCC_LIST, .size = chunk.dwSize, .type = chunk.fccID}; - TRACE("LART chunk (articulations list): %lu bytes\n", size); - IStream_Seek(stream, zero, STREAM_SEEK_CUR, &list_chunk.offset); - list_chunk.offset.QuadPart -= 12; - hr = parse_lart_list(This, stream, &list_chunk); - break; - } - - default: - TRACE("Unknown chunk %s: %lu bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize); - - hr = advance_stream(stream, chunk.dwSize - sizeof(chunk.fccID)); - if (FAILED(hr)) - goto error; - - size = subtract_bytes(size, chunk.dwSize - sizeof(chunk.fccID)); - break; - } - break; - } - - default: - TRACE("Unknown chunk %s: %lu bytes\n", debugstr_fourcc(chunk.fccID), chunk.dwSize); - - hr = advance_stream(stream, chunk.dwSize); - if (FAILED(hr)) - goto error; + case MAKE_IDTYPE(FOURCC_LIST, FOURCC_INS): + hr = parse_ins_chunk(This, stream, &chunk); + break; - break; + default: + WARN("Invalid instrument chunk %s %s\n", debugstr_fourcc(chunk.id), debugstr_fourcc(chunk.type)); + goto error; } } - This->loaded = TRUE; + if (FAILED(hr)) goto error; + This->loaded = TRUE; return S_OK; error: + stream_skip_chunk(stream, &chunk); return DMUS_E_UNSUPPORTED_STREAM; }
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
92
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200