This fixes background music in Tomb Raider II.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 2fb158d5628..8b5eb928cec 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1387,6 +1387,7 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface) { struct gstdemux *filter = impl_from_strmbase_filter(iface); HRESULT hr = VFW_E_NOT_CONNECTED, pin_hr; + const SourceSeeking *seeking; GstStateChangeReturn ret; unsigned int i;
@@ -1407,6 +1408,23 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface) if (filter->no_more_pads_event) 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) { if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->sources[i]->pin)))