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
54d74a05
Commit
54d74a05
authored
Nov 21, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Don't query the pad position in IMediaSeeking::SetPositions().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1bb7ef1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
50 deletions
+30
-50
gstdemux.c
dlls/winegstreamer/gstdemux.c
+30
-50
No files found.
dlls/winegstreamer/gstdemux.c
View file @
54d74a05
...
...
@@ -1897,63 +1897,43 @@ static ULONG WINAPI GST_Seeking_Release(IMediaSeeking *iface)
return
IPin_Release
(
&
This
->
pin
.
pin
.
IPin_iface
);
}
static
GstSeekType
type_from_flags
(
DWORD
flags
)
{
switch
(
flags
&
AM_SEEKING_PositioningBitsMask
)
{
case
AM_SEEKING_NoPositioning
:
return
GST_SEEK_TYPE_NONE
;
case
AM_SEEKING_AbsolutePositioning
:
case
AM_SEEKING_RelativePositioning
:
return
GST_SEEK_TYPE_SET
;
case
AM_SEEKING_IncrementalPositioning
:
return
GST_SEEK_TYPE_END
;
}
return
GST_SEEK_TYPE_NONE
;
}
static
HRESULT
WINAPI
GST_Seeking_SetPositions
(
IMediaSeeking
*
iface
,
REFERENCE_TIME
*
pCur
,
DWORD
curflags
,
REFERENCE_TIME
*
pStop
,
DWORD
stopflags
)
LONGLONG
*
current
,
DWORD
current_flags
,
LONGLONG
*
stop
,
DWORD
stop_flags
)
{
HRESULT
hr
;
struct
gstdemux_source
*
This
=
impl_from_IMediaSeeking
(
iface
);
GstSeekFlags
f
=
0
;
GstSeekType
curtype
,
stoptype
;
GstEvent
*
e
;
gint64
stop_pos
=
0
,
curr_pos
=
0
;
GstSeekType
current_type
=
GST_SEEK_TYPE_SET
,
stop_type
=
GST_SEEK_TYPE_SET
;
struct
gstdemux_source
*
pin
=
impl_from_IMediaSeeking
(
iface
);
GstSeekFlags
flags
=
0
;
TRACE
(
"(%p)->(%p, 0x%x, %p, 0x%x)
\n
"
,
This
,
pCur
,
curflags
,
pStop
,
stopflags
);
TRACE
(
"pin %p, current %s, current_flags %#x, stop %s, stop_flags %#x.
\n
"
,
pin
,
current
?
debugstr_time
(
*
current
)
:
"<null>"
,
current_flags
,
stop
?
debugstr_time
(
*
stop
)
:
"<null>"
,
stop_flags
);
mark_wine_thread
();
hr
=
SourceSeekingImpl_SetPositions
(
iface
,
pCur
,
curflags
,
pStop
,
stopflags
);
if
(
This
->
pin
.
pin
.
filter
->
state
==
State_Stopped
)
return
hr
;
curtype
=
type_from_flags
(
curflags
);
stoptype
=
type_from_flags
(
stopflags
);
if
(
curflags
&
AM_SEEKING_SeekToKeyFrame
)
f
|=
GST_SEEK_FLAG_KEY_UNIT
;
if
(
curflags
&
AM_SEEKING_Segment
)
f
|=
GST_SEEK_FLAG_SEGMENT
;
if
(
!
(
curflags
&
AM_SEEKING_NoFlush
))
f
|=
GST_SEEK_FLAG_FLUSH
;
if
(((
curflags
&
AM_SEEKING_PositioningBitsMask
)
==
AM_SEEKING_RelativePositioning
)
||
((
stopflags
&
AM_SEEKING_PositioningBitsMask
)
==
AM_SEEKING_RelativePositioning
))
{
gint64
tmp_pos
;
gst_pad_query_position
(
This
->
my_sink
,
GST_FORMAT_TIME
,
&
tmp_pos
);
if
((
curflags
&
AM_SEEKING_PositioningBitsMask
)
==
AM_SEEKING_RelativePositioning
)
curr_pos
=
tmp_pos
;
if
((
stopflags
&
AM_SEEKING_PositioningBitsMask
)
==
AM_SEEKING_RelativePositioning
)
stop_pos
=
tmp_pos
;
}
e
=
gst_event_new_seek
(
This
->
seek
.
dRate
,
GST_FORMAT_TIME
,
f
,
curtype
,
pCur
?
curr_pos
+
*
pCur
*
100
:
-
1
,
stoptype
,
pStop
?
stop_pos
+
*
pStop
*
100
:
-
1
);
if
(
gst_pad_push_event
(
This
->
my_sink
,
e
))
SourceSeekingImpl_SetPositions
(
iface
,
current
,
current_flags
,
stop
,
stop_flags
);
if
(
pin
->
pin
.
pin
.
filter
->
state
==
State_Stopped
)
return
S_OK
;
else
return
E_NOTIMPL
;
if
(
current_flags
&
AM_SEEKING_SeekToKeyFrame
)
flags
|=
GST_SEEK_FLAG_KEY_UNIT
;
if
(
current_flags
&
AM_SEEKING_Segment
)
flags
|=
GST_SEEK_FLAG_SEGMENT
;
if
(
!
(
current_flags
&
AM_SEEKING_NoFlush
))
flags
|=
GST_SEEK_FLAG_FLUSH
;
if
((
current_flags
&
AM_SEEKING_PositioningBitsMask
)
==
AM_SEEKING_NoPositioning
)
current_type
=
GST_SEEK_TYPE_NONE
;
if
((
stop_flags
&
AM_SEEKING_PositioningBitsMask
)
==
AM_SEEKING_NoPositioning
)
stop_type
=
GST_SEEK_TYPE_NONE
;
if
(
!
gst_pad_push_event
(
pin
->
my_sink
,
gst_event_new_seek
(
pin
->
seek
.
dRate
,
GST_FORMAT_TIME
,
flags
,
current_type
,
pin
->
seek
.
llCurrent
*
100
,
stop_type
,
pin
->
seek
.
llStop
*
100
)))
{
ERR
(
"Failed to seek (current %s, stop %s).
\n
"
,
debugstr_time
(
pin
->
seek
.
llCurrent
),
debugstr_time
(
pin
->
seek
.
llStop
));
return
E_FAIL
;
}
return
S_OK
;
}
static
const
IMediaSeekingVtbl
GST_Seeking_Vtbl
=
...
...
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