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
c46b9277
Commit
c46b9277
authored
Feb 26, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3dmod: Implement IMediaObject::Flush().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1673af4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
3 deletions
+49
-3
mp3dmod.c
dlls/mp3dmod/mp3dmod.c
+13
-2
mp3dmod.c
dlls/mp3dmod/tests/mp3dmod.c
+36
-1
No files found.
dlls/mp3dmod/mp3dmod.c
View file @
c46b9277
...
@@ -358,9 +358,20 @@ static HRESULT WINAPI MediaObject_SetInputMaxLatency(IMediaObject *iface, DWORD
...
@@ -358,9 +358,20 @@ static HRESULT WINAPI MediaObject_SetInputMaxLatency(IMediaObject *iface, DWORD
static
HRESULT
WINAPI
MediaObject_Flush
(
IMediaObject
*
iface
)
static
HRESULT
WINAPI
MediaObject_Flush
(
IMediaObject
*
iface
)
{
{
FIXME
(
"(%p)->() stub!
\n
"
,
iface
);
struct
mp3_decoder
*
dmo
=
impl_from_IMediaObject
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"iface %p.
\n
"
,
iface
);
if
(
dmo
->
buffer
)
IMediaBuffer_Release
(
dmo
->
buffer
);
dmo
->
buffer
=
NULL
;
dmo
->
timestamp
=
0
;
/* mpg123 doesn't give us a way to flush, so just close and reopen the feed. */
mpg123_close
(
dmo
->
mh
);
mpg123_open_feed
(
dmo
->
mh
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
MediaObject_Discontinuity
(
IMediaObject
*
iface
,
DWORD
index
)
static
HRESULT
WINAPI
MediaObject_Discontinuity
(
IMediaObject
*
iface
,
DWORD
index
)
...
...
dlls/mp3dmod/tests/mp3dmod.c
View file @
c46b9277
...
@@ -230,6 +230,7 @@ static void test_convert(void)
...
@@ -230,6 +230,7 @@ static void test_convert(void)
"got %s
\n
"
,
wine_dbgstr_longlong
(
output
.
rtTimelength
));
"got %s
\n
"
,
wine_dbgstr_longlong
(
output
.
rtTimelength
));
ok
(
inbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
ok
(
inbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
ok
(
outbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
ok
(
outbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
written
+=
outbuf
.
len
;
hr
=
IMediaObject_ProcessOutput
(
dmo
,
0
,
1
,
&
output
,
&
status
);
hr
=
IMediaObject_ProcessOutput
(
dmo
,
0
,
1
,
&
output
,
&
status
);
ok
(
hr
==
S_FALSE
,
"got %#x
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"got %#x
\n
"
,
hr
);
...
@@ -277,7 +278,41 @@ static void test_convert(void)
...
@@ -277,7 +278,41 @@ static void test_convert(void)
outbuf
.
maxlen
=
5000
;
outbuf
.
maxlen
=
5000
;
hr
=
IMediaObject_ProcessOutput
(
dmo
,
0
,
1
,
&
output
,
&
status
);
hr
=
IMediaObject_ProcessOutput
(
dmo
,
0
,
1
,
&
output
,
&
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
outbuf
.
len
>
1152
&&
outbuf
.
len
<=
5000
,
"got %u
\n
"
,
written
);
ok
(
outbuf
.
len
>
1152
&&
outbuf
.
len
<=
5000
,
"Got length %u.
\n
"
,
outbuf
.
len
);
ok
(
output
.
dwStatus
==
(
O_SYNCPOINT
|
O_TIME
|
O_TIMELENGTH
|
O_INCOMPLETE
),
"Got status %#x.
\n
"
,
output
.
dwStatus
);
ok
(
output
.
rtTimestamp
==
samplelen
(
written
,
48000
),
"Got timestamp %s.
\n
"
,
wine_dbgstr_longlong
(
output
.
rtTimestamp
));
ok
(
output
.
rtTimelength
==
samplelen
(
outbuf
.
len
,
48000
),
"Got length %s.
\n
"
,
wine_dbgstr_longlong
(
output
.
rtTimelength
));
ok
(
inbuf
.
refcount
==
2
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
ok
(
outbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
hr
=
IMediaObject_Flush
(
dmo
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
inbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
outbuf
.
len
=
0
;
outbuf
.
maxlen
=
5000
;
hr
=
IMediaObject_ProcessOutput
(
dmo
,
0
,
1
,
&
output
,
&
status
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaObject_Flush
(
dmo
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaObject_ProcessInput
(
dmo
,
0
,
&
inbuf
.
IMediaBuffer_iface
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
hr
=
IMediaObject_ProcessOutput
(
dmo
,
0
,
1
,
&
output
,
&
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
outbuf
.
len
>
1152
&&
outbuf
.
len
<=
5000
,
"Got length %u.
\n
"
,
outbuf
.
len
);
ok
(
output
.
dwStatus
==
(
O_SYNCPOINT
|
O_TIME
|
O_TIMELENGTH
|
O_INCOMPLETE
),
"Got status %#x.
\n
"
,
output
.
dwStatus
);
ok
(
!
output
.
rtTimestamp
,
"Got timestamp %s.
\n
"
,
wine_dbgstr_longlong
(
output
.
rtTimestamp
));
ok
(
output
.
rtTimelength
==
samplelen
(
outbuf
.
len
,
48000
),
"Got length %s.
\n
"
,
wine_dbgstr_longlong
(
output
.
rtTimelength
));
ok
(
inbuf
.
refcount
==
2
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
ok
(
outbuf
.
refcount
==
1
,
"Got refcount %d.
\n
"
,
inbuf
.
refcount
);
IMediaObject_Release
(
dmo
);
IMediaObject_Release
(
dmo
);
ok
(
inbuf
.
refcount
==
1
,
"Got outstanding refcount %d.
\n
"
,
inbuf
.
refcount
);
ok
(
inbuf
.
refcount
==
1
,
"Got outstanding refcount %d.
\n
"
,
inbuf
.
refcount
);
...
...
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