winegstreamer: Defer a seek to pause time if necessary.
This fixes background music in Tomb Raider II. Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7987e84229
commit
2620d649c3
|
@ -1387,6 +1387,7 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface)
|
||||||
{
|
{
|
||||||
struct gstdemux *filter = impl_from_strmbase_filter(iface);
|
struct gstdemux *filter = impl_from_strmbase_filter(iface);
|
||||||
HRESULT hr = VFW_E_NOT_CONNECTED, pin_hr;
|
HRESULT hr = VFW_E_NOT_CONNECTED, pin_hr;
|
||||||
|
const SourceSeeking *seeking;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -1407,6 +1408,23 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface)
|
||||||
if (filter->no_more_pads_event)
|
if (filter->no_more_pads_event)
|
||||||
WaitForSingleObject(filter->no_more_pads_event, INFINITE);
|
WaitForSingleObject(filter->no_more_pads_event, INFINITE);
|
||||||
|
|
||||||
|
seeking = &filter->sources[0]->seek;
|
||||||
|
|
||||||
|
/* GStreamer can't seek while stopped, and it resets position to the
|
||||||
|
* beginning of the stream every time it is stopped. */
|
||||||
|
if (seeking->llCurrent)
|
||||||
|
{
|
||||||
|
GstSeekType stop_type = GST_SEEK_TYPE_NONE;
|
||||||
|
|
||||||
|
if (seeking->llStop && seeking->llStop != seeking->llDuration)
|
||||||
|
stop_type = GST_SEEK_TYPE_SET;
|
||||||
|
|
||||||
|
gst_pad_push_event(filter->sources[0]->my_sink, gst_event_new_seek(
|
||||||
|
seeking->dRate, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
|
||||||
|
GST_SEEK_TYPE_SET, seeking->llCurrent * 100,
|
||||||
|
stop_type, seeking->llStop * 100));
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < filter->source_count; ++i)
|
for (i = 0; i < filter->source_count; ++i)
|
||||||
{
|
{
|
||||||
if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->sources[i]->pin)))
|
if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->sources[i]->pin)))
|
||||||
|
|
Loading…
Reference in New Issue