Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a4c1dec8
Commit
a4c1dec8
authored
Sep 15, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Use segment_append_track in Clone and parse_track_form.
parent
0bdc248c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
35 deletions
+11
-35
segment.c
dlls/dmime/segment.c
+11
-35
No files found.
dlls/dmime/segment.c
View file @
a4c1dec8
...
...
@@ -407,14 +407,12 @@ static HRESULT WINAPI segment_Clone(IDirectMusicSegment8 *iface, MUSIC_TIME star
struct
segment
*
This
=
impl_from_IDirectMusicSegment8
(
iface
);
struct
segment
*
clone
;
IDirectMusicTrack
*
track
;
struct
track_entry
*
track_item
,
*
cloned_item
;
HRESULT
hr
;
BOOL
track_clone_fail
=
FALSE
;
struct
track_entry
*
entry
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p, %ld, %ld, %p)
\n
"
,
This
,
start
,
end
,
segment
);
if
(
!
segment
)
return
E_POINTER
;
if
(
!
segment
)
return
E_POINTER
;
if
(
!
(
clone
=
segment_create
()))
{
...
...
@@ -423,32 +421,16 @@ static HRESULT WINAPI segment_Clone(IDirectMusicSegment8 *iface, MUSIC_TIME star
}
clone
->
header
=
This
->
header
;
clone
->
pGraph
=
This
->
pGraph
;
if
(
clone
->
pGraph
)
IDirectMusicGraph_AddRef
(
clone
->
pGraph
);
LIST_FOR_EACH_ENTRY
(
track_item
,
&
This
->
tracks
,
struct
track_entry
,
entry
)
{
if
(
SUCCEEDED
(
hr
=
IDirectMusicTrack_Clone
(
track_item
->
pTrack
,
start
,
end
,
&
track
)))
{
if
((
cloned_item
=
malloc
(
sizeof
(
*
cloned_item
))))
{
cloned_item
->
dwGroupBits
=
track_item
->
dwGroupBits
;
cloned_item
->
flags
=
track_item
->
flags
;
cloned_item
->
pTrack
=
track
;
list_add_tail
(
&
clone
->
tracks
,
&
cloned_item
->
entry
);
continue
;
}
else
{
IDirectMusicTrack_Release
(
track
);
}
}
WARN
(
"Failed to clone track %p: %#lx
\n
"
,
track_item
->
pTrack
,
hr
);
track_clone_fail
=
TRUE
;
if
((
clone
->
pGraph
=
This
->
pGraph
))
IDirectMusicGraph_AddRef
(
clone
->
pGraph
);
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
tracks
,
struct
track_entry
,
entry
)
{
if
(
FAILED
(
hr
=
IDirectMusicTrack_Clone
(
entry
->
pTrack
,
start
,
end
,
&
track
)))
break
;
if
(
FAILED
(
hr
=
segment_append_track
(
clone
,
track
,
entry
->
dwGroupBits
,
entry
->
flags
)))
break
;
}
*
segment
=
(
IDirectMusicSegment
*
)
&
clone
->
IDirectMusicSegment8_iface
;
return
track_clone_fail
?
S_FALSE
:
S_OK
;
return
FAILED
(
hr
)
?
S_FALSE
:
S_OK
;
}
static
HRESULT
WINAPI
segment_SetStartPoint
(
IDirectMusicSegment8
*
iface
,
MUSIC_TIME
start
)
...
...
@@ -635,7 +617,6 @@ static HRESULT parse_track_form(struct segment *This, IStream *stream, const str
DMUS_IO_TRACK_HEADER
thdr
;
DMUS_IO_TRACK_EXTRAS_HEADER
txhdr
=
{
0
};
HRESULT
hr
;
struct
track_entry
*
item
;
TRACE
(
"Parsing track form in %p: %s
\n
"
,
stream
,
debugstr_chunk
(
riff
));
...
...
@@ -691,12 +672,7 @@ static HRESULT parse_track_form(struct segment *This, IStream *stream, const str
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IDirectMusicSegment8_InsertTrack
(
&
This
->
IDirectMusicSegment8_iface
,
track
,
thdr
.
dwGroup
);
if
(
FAILED
(
hr
))
goto
done
;
item
=
LIST_ENTRY
(
list_tail
(
&
This
->
tracks
),
struct
track_entry
,
entry
);
item
->
flags
=
txhdr
.
dwFlags
;
hr
=
segment_append_track
(
This
,
track
,
thdr
.
dwGroup
,
txhdr
.
dwFlags
);
done:
if
(
ps
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment