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
da4318b2
Commit
da4318b2
authored
Mar 13, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Use ParseDescriptor() instead of reimplementing it.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a4627352
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
291 deletions
+14
-291
audiopath.c
dlls/dmime/audiopath.c
+7
-146
graph.c
dlls/dmime/graph.c
+7
-145
No files found.
dlls/dmime/audiopath.c
View file @
da4318b2
...
...
@@ -21,7 +21,6 @@
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
struct
IDirectMusicAudioPathImpl
{
IDirectMusicAudioPath
IDirectMusicAudioPath_iface
;
...
...
@@ -305,152 +304,14 @@ static const IDirectMusicObjectVtbl dmobject_vtbl = {
};
/* IPersistStream */
static
HRESULT
WINAPI
PersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
pSt
m
)
static
HRESULT
WINAPI
path_IPersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
strea
m
)
{
struct
IDirectMusicAudioPathImpl
*
This
=
impl_from_IPersistStream
(
iface
);
FOURCC
chunkID
;
DWORD
chunkSize
,
StreamSize
,
StreamCount
,
ListSize
[
3
],
ListCount
[
3
];
LARGE_INTEGER
liMove
;
/* used when skipping chunks */
FIXME
(
"(%p, %p): Loading not implemented yet
\n
"
,
This
,
pStm
);
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
IStream_Read
(
pStm
,
&
chunkSize
,
sizeof
(
DWORD
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = %d)"
,
debugstr_fourcc
(
chunkID
),
chunkSize
);
switch
(
chunkID
)
{
case
FOURCC_RIFF
:
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": RIFF chunk of type %s"
,
debugstr_fourcc
(
chunkID
));
StreamSize
=
chunkSize
-
sizeof
(
FOURCC
);
StreamCount
=
0
;
switch
(
chunkID
)
{
case
DMUS_FOURCC_AUDIOPATH_FORM
:
{
TRACE_
(
dmfile
)(
": audio path form
\n
"
);
do
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
IStream_Read
(
pStm
,
&
chunkSize
,
sizeof
(
FOURCC
),
NULL
);
StreamCount
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
chunkSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = %d)"
,
debugstr_fourcc
(
chunkID
),
chunkSize
);
switch
(
chunkID
)
{
case
DMUS_FOURCC_GUID_CHUNK
:
{
TRACE_
(
dmfile
)(
": GUID chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_OBJECT
;
IStream_Read
(
pStm
,
&
This
->
dmobj
.
desc
.
guidObject
,
chunkSize
,
NULL
);
break
;
}
case
DMUS_FOURCC_VERSION_CHUNK
:
{
TRACE_
(
dmfile
)(
": version chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_VERSION
;
IStream_Read
(
pStm
,
&
This
->
dmobj
.
desc
.
vVersion
,
chunkSize
,
NULL
);
break
;
}
case
DMUS_FOURCC_CATEGORY_CHUNK
:
{
TRACE_
(
dmfile
)(
": category chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_CATEGORY
;
IStream_Read
(
pStm
,
This
->
dmobj
.
desc
.
wszCategory
,
chunkSize
,
NULL
);
break
;
}
case
FOURCC_LIST
:
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": LIST chunk of type %s"
,
debugstr_fourcc
(
chunkID
));
ListSize
[
0
]
=
chunkSize
-
sizeof
(
FOURCC
);
ListCount
[
0
]
=
0
;
switch
(
chunkID
)
{
case
DMUS_FOURCC_UNFO_LIST
:
{
TRACE_
(
dmfile
)(
": UNFO list
\n
"
);
do
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
IStream_Read
(
pStm
,
&
chunkSize
,
sizeof
(
FOURCC
),
NULL
);
ListCount
[
0
]
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
chunkSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = %d)"
,
debugstr_fourcc
(
chunkID
),
chunkSize
);
switch
(
chunkID
)
{
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case
mmioFOURCC
(
'I'
,
'N'
,
'A'
,
'M'
):
case
DMUS_FOURCC_UNAM_CHUNK
:
{
TRACE_
(
dmfile
)(
": name chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_NAME
;
IStream_Read
(
pStm
,
This
->
dmobj
.
desc
.
wszName
,
chunkSize
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'A'
,
'R'
,
'T'
):
case
DMUS_FOURCC_UART_CHUNK
:
{
TRACE_
(
dmfile
)(
": artist chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'C'
,
'O'
,
'P'
):
case
DMUS_FOURCC_UCOP_CHUNK
:
{
TRACE_
(
dmfile
)(
": copyright chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'S'
,
'B'
,
'J'
):
case
DMUS_FOURCC_USBJ_CHUNK
:
{
TRACE_
(
dmfile
)(
": subject chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'C'
,
'M'
,
'T'
):
case
DMUS_FOURCC_UCMT_CHUNK
:
{
TRACE_
(
dmfile
)(
": comment chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": ListCount[0] = %d < ListSize[0] = %d
\n
"
,
ListCount
[
0
],
ListSize
[
0
]);
}
while
(
ListCount
[
0
]
<
ListSize
[
0
]);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown (skipping)
\n
"
);
liMove
.
QuadPart
=
chunkSize
-
sizeof
(
FOURCC
);
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": StreamCount[0] = %d < StreamSize[0] = %d
\n
"
,
StreamCount
,
StreamSize
);
}
while
(
StreamCount
<
StreamSize
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
StreamSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
E_FAIL
;
}
}
TRACE_
(
dmfile
)(
": reading finished
\n
"
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
E_FAIL
;
}
}
struct
IDirectMusicAudioPathImpl
*
This
=
impl_from_IPersistStream
(
iface
);
FIXME
(
"(%p, %p): Loading not implemented yet
\n
"
,
This
,
stream
);
return
S_OK
;
return
IDirectMusicObject_ParseDescriptor
(
&
This
->
dmobj
.
IDirectMusicObject_iface
,
stream
,
&
This
->
dmobj
.
desc
);
}
static
const
IPersistStreamVtbl
persiststream_vtbl
=
{
...
...
@@ -459,7 +320,7 @@ static const IPersistStreamVtbl persiststream_vtbl = {
dmobj_IPersistStream_Release
,
dmobj_IPersistStream_GetClassID
,
unimpl_IPersistStream_IsDirty
,
PersistStream_Load
,
path_I
PersistStream_Load
,
unimpl_IPersistStream_Save
,
unimpl_IPersistStream_GetSizeMax
};
...
...
dlls/dmime/graph.c
View file @
da4318b2
...
...
@@ -21,7 +21,6 @@
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
struct
IDirectMusicGraphImpl
{
IDirectMusicGraph
IDirectMusicGraph_iface
;
...
...
@@ -235,151 +234,14 @@ static const IDirectMusicObjectVtbl dmobject_vtbl = {
graph_IDirectMusicObject_ParseDescriptor
};
static
HRESULT
WINAPI
PersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
pSt
m
)
static
HRESULT
WINAPI
graph_IPersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
strea
m
)
{
IDirectMusicGraphImpl
*
This
=
impl_from_IPersistStream
(
iface
);
FOURCC
chunkID
;
DWORD
chunkSize
,
StreamSize
,
StreamCount
,
ListSize
[
3
],
ListCount
[
3
];
LARGE_INTEGER
liMove
;
/* used when skipping chunks */
FIXME
(
"(%p, %p): Loading not implemented yet
\n
"
,
This
,
pStm
);
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
IStream_Read
(
pStm
,
&
chunkSize
,
sizeof
(
DWORD
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = %d)"
,
debugstr_fourcc
(
chunkID
),
chunkSize
);
switch
(
chunkID
)
{
case
FOURCC_RIFF
:
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": RIFF chunk of type %s"
,
debugstr_fourcc
(
chunkID
));
StreamSize
=
chunkSize
-
sizeof
(
FOURCC
);
StreamCount
=
0
;
switch
(
chunkID
)
{
case
DMUS_FOURCC_TOOLGRAPH_FORM
:
{
TRACE_
(
dmfile
)(
": graph form
\n
"
);
do
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
IStream_Read
(
pStm
,
&
chunkSize
,
sizeof
(
FOURCC
),
NULL
);
StreamCount
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
chunkSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = %d)"
,
debugstr_fourcc
(
chunkID
),
chunkSize
);
switch
(
chunkID
)
{
case
DMUS_FOURCC_GUID_CHUNK
:
{
TRACE_
(
dmfile
)(
": GUID chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_OBJECT
;
IStream_Read
(
pStm
,
&
This
->
dmobj
.
desc
.
guidObject
,
chunkSize
,
NULL
);
break
;
}
case
DMUS_FOURCC_VERSION_CHUNK
:
{
TRACE_
(
dmfile
)(
": version chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_VERSION
;
IStream_Read
(
pStm
,
&
This
->
dmobj
.
desc
.
vVersion
,
chunkSize
,
NULL
);
break
;
}
case
DMUS_FOURCC_CATEGORY_CHUNK
:
{
TRACE_
(
dmfile
)(
": category chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_CATEGORY
;
IStream_Read
(
pStm
,
This
->
dmobj
.
desc
.
wszCategory
,
chunkSize
,
NULL
);
break
;
}
case
FOURCC_LIST
:
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": LIST chunk of type %s"
,
debugstr_fourcc
(
chunkID
));
ListSize
[
0
]
=
chunkSize
-
sizeof
(
FOURCC
);
ListCount
[
0
]
=
0
;
switch
(
chunkID
)
{
case
DMUS_FOURCC_UNFO_LIST
:
{
TRACE_
(
dmfile
)(
": UNFO list
\n
"
);
do
{
IStream_Read
(
pStm
,
&
chunkID
,
sizeof
(
FOURCC
),
NULL
);
IStream_Read
(
pStm
,
&
chunkSize
,
sizeof
(
FOURCC
),
NULL
);
ListCount
[
0
]
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
chunkSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = %d)"
,
debugstr_fourcc
(
chunkID
),
chunkSize
);
switch
(
chunkID
)
{
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case
mmioFOURCC
(
'I'
,
'N'
,
'A'
,
'M'
):
case
DMUS_FOURCC_UNAM_CHUNK
:
{
TRACE_
(
dmfile
)(
": name chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_NAME
;
IStream_Read
(
pStm
,
This
->
dmobj
.
desc
.
wszName
,
chunkSize
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'A'
,
'R'
,
'T'
):
case
DMUS_FOURCC_UART_CHUNK
:
{
TRACE_
(
dmfile
)(
": artist chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'C'
,
'O'
,
'P'
):
case
DMUS_FOURCC_UCOP_CHUNK
:
{
TRACE_
(
dmfile
)(
": copyright chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'S'
,
'B'
,
'J'
):
case
DMUS_FOURCC_USBJ_CHUNK
:
{
TRACE_
(
dmfile
)(
": subject chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'C'
,
'M'
,
'T'
):
case
DMUS_FOURCC_UCMT_CHUNK
:
{
TRACE_
(
dmfile
)(
": comment chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": ListCount[0] = %d < ListSize[0] = %d
\n
"
,
ListCount
[
0
],
ListSize
[
0
]);
}
while
(
ListCount
[
0
]
<
ListSize
[
0
]);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown (skipping)
\n
"
);
liMove
.
QuadPart
=
chunkSize
-
sizeof
(
FOURCC
);
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": StreamCount[0] = %d < StreamSize[0] = %d
\n
"
,
StreamCount
,
StreamSize
);
}
while
(
StreamCount
<
StreamSize
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
StreamSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
E_FAIL
;
}
}
TRACE_
(
dmfile
)(
": reading finished
\n
"
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
chunkSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
E_FAIL
;
}
}
return
S_OK
;
FIXME
(
"(%p, %p): Loading not implemented yet
\n
"
,
This
,
stream
);
return
IDirectMusicObject_ParseDescriptor
(
&
This
->
dmobj
.
IDirectMusicObject_iface
,
stream
,
&
This
->
dmobj
.
desc
);
}
static
const
IPersistStreamVtbl
persiststream_vtbl
=
{
...
...
@@ -388,7 +250,7 @@ static const IPersistStreamVtbl persiststream_vtbl = {
dmobj_IPersistStream_Release
,
dmobj_IPersistStream_GetClassID
,
unimpl_IPersistStream_IsDirty
,
PersistStream_Load
,
graph_I
PersistStream_Load
,
unimpl_IPersistStream_Save
,
unimpl_IPersistStream_GetSizeMax
};
...
...
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