Commit 0bdc248c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmime: Rewrite segment IDirectMusicSegment_RemoveTrack.

parent f04976e0
......@@ -285,24 +285,19 @@ static HRESULT WINAPI segment_InsertTrack(IDirectMusicSegment8 *iface, IDirectMu
return segment_append_track(This, track, group, 0);
}
static HRESULT WINAPI segment_RemoveTrack(IDirectMusicSegment8 *iface, IDirectMusicTrack *pTrack)
static HRESULT WINAPI segment_RemoveTrack(IDirectMusicSegment8 *iface, IDirectMusicTrack *track)
{
struct segment *This = impl_from_IDirectMusicSegment8(iface);
struct list* pEntry = NULL;
struct track_entry *pIt = NULL;
TRACE("(%p, %p)\n", This, pTrack);
LIST_FOR_EACH (pEntry, &This->tracks) {
pIt = LIST_ENTRY(pEntry, struct track_entry, entry);
if (pIt->pTrack == pTrack) {
TRACE("(%p, %p): track in list\n", This, pTrack);
struct track_entry *entry;
list_remove(&pIt->entry);
IDirectMusicTrack_Init(pIt->pTrack, NULL);
IDirectMusicTrack_Release(pIt->pTrack);
free(pIt);
TRACE("(%p, %p)\n", This, track);
LIST_FOR_EACH_ENTRY(entry, &This->tracks, struct track_entry, entry)
{
if (entry->pTrack == track)
{
list_remove(&entry->entry);
track_entry_destroy(entry);
return S_OK;
}
}
......
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