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
53446a21
Commit
53446a21
authored
Jun 21, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplay: Keep start/stop positions for items.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b090a169
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
4 deletions
+77
-4
player.c
dlls/mfplay/player.c
+77
-4
No files found.
dlls/mfplay/player.c
View file @
53446a21
...
...
@@ -63,6 +63,8 @@ struct media_item
DWORD_PTR
user_data
;
WCHAR
*
url
;
IUnknown
*
object
;
LONGLONG
start_position
;
LONGLONG
stop_position
;
};
struct
media_player
...
...
@@ -418,21 +420,92 @@ static HRESULT WINAPI media_item_SetUserData(IMFPMediaItem *iface, DWORD_PTR use
return
S_OK
;
}
static
HRESULT
media_item_set_position
(
const
GUID
*
format
,
const
PROPVARIANT
*
position
,
LARGE_INTEGER
*
ret
)
{
ret
->
QuadPart
=
0
;
if
(
format
&&
!
IsEqualGUID
(
format
,
&
MFP_POSITIONTYPE_100NS
))
return
E_INVALIDARG
;
if
((
format
!=
NULL
)
^
(
position
!=
NULL
))
return
E_POINTER
;
if
(
position
&&
position
->
vt
!=
VT_EMPTY
&&
position
->
vt
!=
VT_I8
)
return
E_INVALIDARG
;
if
((
!
format
&&
!
position
)
||
position
->
vt
==
VT_EMPTY
)
return
S_OK
;
if
(
position
->
hVal
.
QuadPart
==
0
)
return
MF_E_OUT_OF_RANGE
;
ret
->
QuadPart
=
position
->
hVal
.
QuadPart
;
return
S_OK
;
}
static
void
media_item_get_position
(
LONGLONG
value
,
GUID
*
format
,
PROPVARIANT
*
position
)
{
if
(
!
format
)
return
;
memcpy
(
format
,
&
MFP_POSITIONTYPE_100NS
,
sizeof
(
*
format
));
if
(
value
)
{
position
->
vt
=
VT_I8
;
position
->
hVal
.
QuadPart
=
value
;
}
}
static
HRESULT
WINAPI
media_item_GetStartStopPosition
(
IMFPMediaItem
*
iface
,
GUID
*
start_format
,
PROPVARIANT
*
start_position
,
GUID
*
stop_format
,
PROPVARIANT
*
stop_position
)
{
FIXME
(
"%p, %p, %p, %p, %p.
\n
"
,
iface
,
start_format
,
start_position
,
stop_format
,
stop_position
);
struct
media_item
*
item
=
impl_from_IMFPMediaItem
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p, %p, %p.
\n
"
,
iface
,
start_format
,
start_position
,
stop_format
,
stop_position
);
if
(
start_position
)
start_position
->
vt
=
VT_EMPTY
;
if
(
stop_position
)
stop_position
->
vt
=
VT_EMPTY
;
if
(((
start_format
!=
NULL
)
^
(
start_position
!=
NULL
))
||
((
stop_format
!=
NULL
)
^
(
stop_position
!=
NULL
)))
{
return
E_POINTER
;
}
media_item_get_position
(
item
->
start_position
,
start_format
,
start_position
);
media_item_get_position
(
item
->
stop_position
,
stop_format
,
stop_position
);
return
S_OK
;
}
static
HRESULT
WINAPI
media_item_SetStartStopPosition
(
IMFPMediaItem
*
iface
,
const
GUID
*
start_format
,
const
PROPVARIANT
*
start_position
,
const
GUID
*
stop_format
,
const
PROPVARIANT
*
stop_position
)
{
FIXME
(
"%p, %s, %p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
start_format
),
start_position
,
struct
media_item
*
item
=
impl_from_IMFPMediaItem
(
iface
);
LARGE_INTEGER
start
,
stop
;
HRESULT
hr
;
TRACE
(
"%p, %s, %p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
start_format
),
start_position
,
debugstr_guid
(
stop_format
),
stop_position
);
return
E_NOTIMPL
;
hr
=
media_item_set_position
(
start_format
,
start_position
,
&
start
);
if
(
SUCCEEDED
(
hr
))
hr
=
media_item_set_position
(
stop_format
,
stop_position
,
&
stop
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
start
.
QuadPart
>
stop
.
QuadPart
)
return
MF_E_OUT_OF_RANGE
;
item
->
start_position
=
start
.
QuadPart
;
item
->
stop_position
=
stop
.
QuadPart
;
return
hr
;
}
static
HRESULT
media_item_get_stream_type
(
IMFStreamDescriptor
*
sd
,
GUID
*
major
)
...
...
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