Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
bb2a8312
Commit
bb2a8312
authored
Sep 09, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Rewrite collection lins list parsing.
parent
4b787aa9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
63 deletions
+43
-63
buffer.c
dlls/dmusic/buffer.c
+0
-1
clock.c
dlls/dmusic/clock.c
+0
-1
collection.c
dlls/dmusic/collection.c
+34
-33
dmusic.c
dlls/dmusic/dmusic.c
+0
-1
dmusic_main.c
dlls/dmusic/dmusic_main.c
+0
-1
dmusic_private.h
dlls/dmusic/dmusic_private.h
+4
-1
download.c
dlls/dmusic/download.c
+0
-1
instrument.c
dlls/dmusic/instrument.c
+5
-23
port.c
dlls/dmusic/port.c
+0
-1
No files found.
dlls/dmusic/buffer.c
View file @
bb2a8312
...
...
@@ -20,7 +20,6 @@
*/
#include "dmusic_private.h"
#include "dmobject.h"
#include "initguid.h"
#include "dmksctrl.h"
...
...
dlls/dmusic/clock.c
View file @
bb2a8312
...
...
@@ -19,7 +19,6 @@
*/
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
...
...
dlls/dmusic/collection.c
View file @
bb2a8312
...
...
@@ -19,7 +19,6 @@
*/
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
...
@@ -177,6 +176,34 @@ static const IDirectMusicCollectionVtbl collection_vtbl =
collection_EnumInstrument
,
};
static
HRESULT
parse_lins_list
(
struct
collection
*
This
,
IStream
*
stream
,
struct
chunk_entry
*
parent
)
{
struct
chunk_entry
chunk
=
{.
parent
=
parent
};
struct
instrument_entry
*
entry
;
HRESULT
hr
;
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
{
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_INS
):
if
(
!
(
entry
=
malloc
(
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
hr
=
instrument_create_from_chunk
(
stream
,
&
chunk
,
&
entry
->
instrument
);
if
(
SUCCEEDED
(
hr
))
list_add_tail
(
&
This
->
instruments
,
&
entry
->
entry
);
else
free
(
entry
);
break
;
default:
FIXME
(
"Ignoring chunk %s %s
\n
"
,
debugstr_fourcc
(
chunk
.
id
),
debugstr_fourcc
(
chunk
.
type
));
break
;
}
if
(
FAILED
(
hr
))
break
;
}
return
hr
;
}
static
HRESULT
WINAPI
collection_object_ParseDescriptor
(
IDirectMusicObject
*
iface
,
IStream
*
stream
,
DMUS_OBJECTDESC
*
desc
)
{
...
...
@@ -373,39 +400,13 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface,
break
;
}
case
FOURCC_LINS
:
{
struct
chunk_entry
lins_chunk
=
{.
id
=
FOURCC_LIST
,
.
size
=
chunk
.
dwSize
,
.
type
=
chunk
.
fccID
};
TRACE_
(
dmfile
)(
": instruments list
\n
"
);
do
{
IStream_Read
(
stream
,
&
chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
ListCount
[
0
]
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
chunk
.
dwSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = %#04lx)"
,
debugstr_fourcc
(
chunk
.
fccID
),
chunk
.
dwSize
);
switch
(
chunk
.
fccID
)
{
case
FOURCC_LIST
:
{
IStream_Read
(
stream
,
&
chunk
.
fccID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": LIST chunk of type %s"
,
debugstr_fourcc
(
chunk
.
fccID
));
ListSize
[
1
]
=
chunk
.
dwSize
-
sizeof
(
FOURCC
);
ListCount
[
1
]
=
0
;
switch
(
chunk
.
fccID
)
{
case
FOURCC_INS
:
{
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
->
instrument
)))
free
(
entry
);
else
list_add_tail
(
&
This
->
instruments
,
&
entry
->
entry
);
break
;
}
}
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
chunk
.
dwSize
;
IStream_Seek
(
stream
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": ListCount[0] = %ld < ListSize[0] = %ld
\n
"
,
ListCount
[
0
],
ListSize
[
0
]);
}
while
(
ListCount
[
0
]
<
ListSize
[
0
]);
liMove
.
QuadPart
=
0
;
IStream_Seek
(
stream
,
liMove
,
STREAM_SEEK_CUR
,
&
lins_chunk
.
offset
);
lins_chunk
.
offset
.
QuadPart
-=
12
;
parse_lins_list
(
This
,
stream
,
&
lins_chunk
);
stream_skip_chunk
(
stream
,
&
lins_chunk
);
break
;
}
default:
{
...
...
dlls/dmusic/dmusic.c
View file @
bb2a8312
...
...
@@ -22,7 +22,6 @@
#include <stdio.h>
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
...
...
dlls/dmusic/dmusic_main.c
View file @
bb2a8312
...
...
@@ -35,7 +35,6 @@
#include "dmusici.h"
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
...
...
dlls/dmusic/dmusic_private.h
View file @
bb2a8312
...
...
@@ -41,6 +41,8 @@
#include "dmusics.h"
#include "dmksctrl.h"
#include "dmobject.h"
/*****************************************************************************
* Interfaces
*/
...
...
@@ -95,7 +97,8 @@ extern HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj,
extern
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
);
extern
HRESULT
instrument_create_from_stream
(
IStream
*
stream
,
IDirectMusicInstrument
**
ret_iface
);
extern
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
IDirectMusicInstrument
**
ret_iface
);
/*****************************************************************************
* IDirectMusic8Impl implementation structure
...
...
dlls/dmusic/download.c
View file @
bb2a8312
...
...
@@ -19,7 +19,6 @@
*/
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
...
...
dlls/dmusic/instrument.c
View file @
bb2a8312
...
...
@@ -19,7 +19,6 @@
*/
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
...
...
@@ -303,9 +302,9 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct
return
hr
;
}
HRESULT
instrument_create_from_stream
(
IStream
*
stream
,
IDirectMusicInstrument
**
ret_iface
)
HRESULT
instrument_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
IDirectMusicInstrument
**
ret_iface
)
{
struct
chunk_entry
chunk
=
{
0
};
IDirectMusicInstrument
*
iface
;
struct
instrument
*
This
;
HRESULT
hr
;
...
...
@@ -315,23 +314,12 @@ HRESULT instrument_create_from_stream(IStream *stream, IDirectMusicInstrument **
if
(
FAILED
(
hr
=
instrument_create
(
&
iface
)))
return
hr
;
This
=
impl_from_IDirectMusicInstrument
(
iface
);
if
(
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
if
(
FAILED
(
hr
=
parse_ins_chunk
(
This
,
stream
,
parent
))
)
{
switch
(
MAKE_IDTYPE
(
chunk
.
id
,
chunk
.
type
))
{
case
MAKE_IDTYPE
(
FOURCC_LIST
,
FOURCC_INS
):
hr
=
parse_ins_chunk
(
This
,
stream
,
&
chunk
);
break
;
default:
WARN
(
"Invalid instrument chunk %s %s
\n
"
,
debugstr_fourcc
(
chunk
.
id
),
debugstr_fourcc
(
chunk
.
type
));
hr
=
E_INVALIDARG
;
break
;
}
IDirectMusicInstrument_Release
(
iface
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
if
(
FAILED
(
hr
))
goto
error
;
if
(
TRACE_ON
(
dmusic
))
{
TRACE
(
"Created DirectMusicInstrument (%p) ***
\n
"
,
This
);
...
...
@@ -347,10 +335,4 @@ HRESULT instrument_create_from_stream(IStream *stream, IDirectMusicInstrument **
*
ret_iface
=
iface
;
return
S_OK
;
error:
IDirectMusicInstrument_Release
(
iface
);
stream_skip_chunk
(
stream
,
&
chunk
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
dlls/dmusic/port.c
View file @
bb2a8312
...
...
@@ -21,7 +21,6 @@
#include <assert.h>
#include "dmusic_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
...
...
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