Skip to content

Commit d045eae

Browse files
rbernonjulliard
authored andcommitted
dmime: Rewrite segment IDirectMusicSegment_GetTrackGroup.
1 parent a713797 commit d045eae

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

dlls/dmime/segment.c

+11-14
Original file line numberDiff line numberDiff line change
@@ -231,25 +231,22 @@ static HRESULT WINAPI segment_GetTrack(IDirectMusicSegment8 *iface, REFGUID type
231231
return DMUS_E_NOT_FOUND;
232232
}
233233

234-
static HRESULT WINAPI segment_GetTrackGroup(IDirectMusicSegment8 *iface, IDirectMusicTrack *pTrack, DWORD *pdwGroupBits)
234+
static HRESULT WINAPI segment_GetTrackGroup(IDirectMusicSegment8 *iface, IDirectMusicTrack *track, DWORD *ret_group)
235235
{
236236
struct segment *This = impl_from_IDirectMusicSegment8(iface);
237-
struct list* pEntry = NULL;
238-
struct track_entry *pIt = NULL;
237+
struct track_entry *entry;
239238

240-
TRACE("(%p, %p, %p)\n", This, pTrack, pdwGroupBits);
239+
TRACE("(%p, %p, %p)\n", This, track, ret_group);
241240

242-
if (NULL == pdwGroupBits) {
243-
return E_POINTER;
244-
}
241+
if (!ret_group) return E_POINTER;
245242

246-
LIST_FOR_EACH (pEntry, &This->tracks) {
247-
pIt = LIST_ENTRY(pEntry, struct track_entry, entry);
248-
TRACE(" - %p -> %#lx, %p\n", pIt, pIt->dwGroupBits, pIt->pTrack);
249-
if (NULL != pIt && pIt->pTrack == pTrack) {
250-
*pdwGroupBits = pIt->dwGroupBits;
251-
return S_OK;
252-
}
243+
LIST_FOR_EACH_ENTRY(entry, &This->tracks, struct track_entry, entry)
244+
{
245+
if (entry->pTrack == track)
246+
{
247+
*ret_group = entry->dwGroupBits;
248+
return S_OK;
249+
}
253250
}
254251

255252
return DMUS_E_NOT_FOUND;

0 commit comments

Comments
 (0)