This check is not equivalent to the existence of "their_src" for the MPEG-1 splitter, since that always exposes a source audio pin.
Fixes: 40a4c782b7f77534535dfa7bb2a97049026fef47 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 488c9bd8a13..d469f2dbbff 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1841,7 +1841,8 @@ static HRESULT WINAPI GST_Seeking_GetCurrentPosition(IMediaSeeking *iface, REFER
mark_wine_thread();
- if (!This->their_src) { + if (This->pin.pin.filter->state == State_Stopped) + { *pos = This->seek.llCurrent; TRACE("Cached value\n"); if (This->seek.llDuration) @@ -1892,7 +1893,7 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, return E_NOTIMPL;
hr = SourceSeekingImpl_SetPositions(iface, pCur, curflags, pStop, stopflags); - if (!This->their_src) + if (This->pin.pin.filter->state == State_Stopped) return hr;
curtype = type_from_flags(curflags);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48315 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index d469f2dbbff..2fb158d5628 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1601,7 +1601,8 @@ static BOOL gstdecoder_init_gst(struct gstdemux *filter)
WaitForSingleObject(filter->no_more_pads_event, INFINITE);
- gst_pad_query_duration(filter->sources[0]->their_src, GST_FORMAT_TIME, &duration); + if (!gst_pad_query_duration(filter->sources[0]->their_src, GST_FORMAT_TIME, &duration)) + ERR("Failed to query duration.\n"); for (i = 0; i < filter->source_count; ++i) { struct gstdemux_source *pin = filter->sources[i]; @@ -1609,8 +1610,6 @@ static BOOL gstdecoder_init_gst(struct gstdemux *filter)
pin->seek.llDuration = pin->seek.llStop = duration / 100; pin->seek.llCurrent = 0; - if (!pin->seek.llDuration) - pin->seek.dwCapabilities = 0; if (WaitForMultipleObjects(2, events, FALSE, INFINITE)) return FALSE; } @@ -1845,10 +1844,7 @@ static HRESULT WINAPI GST_Seeking_GetCurrentPosition(IMediaSeeking *iface, REFER { *pos = This->seek.llCurrent; TRACE("Cached value\n"); - if (This->seek.llDuration) - return S_OK; - else - return E_NOTIMPL; + return S_OK; }
if (!gst_pad_query_position(This->their_src, GST_FORMAT_TIME, pos)) { @@ -1889,9 +1885,6 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
mark_wine_thread();
- if (!This->seek.llDuration) - return E_NOTIMPL; - hr = SourceSeekingImpl_SetPositions(iface, pCur, curflags, pStop, stopflags); if (This->pin.pin.filter->state == State_Stopped) return hr; @@ -2377,11 +2370,10 @@ static BOOL wave_parser_init_gst(struct gstdemux *filter) return FALSE; }
- gst_pad_query_duration(pin->their_src, GST_FORMAT_TIME, &duration); + if (!gst_pad_query_duration(pin->their_src, GST_FORMAT_TIME, &duration)) + ERR("Failed to query duration.\n"); pin->seek.llDuration = pin->seek.llStop = duration / 100; pin->seek.llCurrent = 0; - if (!pin->seek.llDuration) - pin->seek.dwCapabilities = 0;
events[0] = pin->caps_event; events[1] = filter->error_event; @@ -2496,7 +2488,8 @@ static BOOL avi_splitter_init_gst(struct gstdemux *filter)
WaitForSingleObject(filter->no_more_pads_event, INFINITE);
- gst_pad_query_duration(filter->sources[0]->their_src, GST_FORMAT_TIME, &duration); + if (!gst_pad_query_duration(filter->sources[0]->their_src, GST_FORMAT_TIME, &duration)) + ERR("Failed to query duration.\n"); for (i = 0; i < filter->source_count; ++i) { struct gstdemux_source *pin = filter->sources[i]; @@ -2504,8 +2497,6 @@ static BOOL avi_splitter_init_gst(struct gstdemux *filter)
pin->seek.llDuration = pin->seek.llStop = duration / 100; pin->seek.llCurrent = 0; - if (!pin->seek.llDuration) - pin->seek.dwCapabilities = 0; if (WaitForMultipleObjects(2, events, FALSE, INFINITE)) return FALSE; } @@ -2633,11 +2624,10 @@ static BOOL mpeg_splitter_init_gst(struct gstdemux *filter) if (WaitForMultipleObjects(2, events, FALSE, INFINITE)) return FALSE;
- gst_pad_query_duration(pin->their_src, GST_FORMAT_TIME, &duration); + if (!gst_pad_query_duration(pin->their_src, GST_FORMAT_TIME, &duration)) + ERR("Failed to query duration.\n"); pin->seek.llDuration = pin->seek.llStop = duration / 100; pin->seek.llCurrent = 0; - if (!pin->seek.llDuration) - pin->seek.dwCapabilities = 0;
events[0] = pin->caps_event; if (WaitForMultipleObjects(2, events, FALSE, INFINITE))
This fixes background music in Tomb Raider II.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 2fb158d5628..02bf69cacd9 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1386,6 +1386,7 @@ static void gstdemux_destroy(struct strmbase_filter *iface) static HRESULT gstdemux_init_stream(struct strmbase_filter *iface) { struct gstdemux *filter = impl_from_strmbase_filter(iface); + const SourceSeeking *seeking = &filter->sources[0]->seek; HRESULT hr = VFW_E_NOT_CONNECTED, pin_hr; GstStateChangeReturn ret; unsigned int i; @@ -1407,6 +1408,21 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface) if (filter->no_more_pads_event) WaitForSingleObject(filter->no_more_pads_event, INFINITE);
+ /* 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)))
Zebediah Figura z.figura12@gmail.com writes:
This fixes background music in Tomb Raider II.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
dlls/winegstreamer/gstdemux.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
This breaks the tests:
../../../tools/runtest -q -P wine -T ../../.. -M quartz.dll -p quartz_test.exe avisplit && touch avisplit.ok wine: Unhandled page fault on read access to 00000000 at address 7DE2C712 (thread 0040), starting debugger... Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7de2c712). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:7de2c712 ESP:0089fcf0 EBP:0089fd18 EFLAGS:00010206( R- -- I - -P- ) EAX:00000000 EBX:00e981e8 ECX:0089fd20 EDX:004a7afc ESI:00000000 EDI:00e981f8 Stack dump: 0x0089fcf0: 00000003 0089fd10 7eae1c80 0089fd20 0x0089fd00: 00e981e8 00000000 0089fd48 00e981e8 0x0089fd10: 00000000 00e981f8 0089fd48 7de279a0 0x0089fd20: 00e981e8 004837d0 0089fd58 0047a0bd 0x0089fd30: 00e981e8 00000000 0089fd60 00e981e8 0x0089fd40: 00000000 004837d0 0089fe18 0040fb49 Backtrace: =>0 0x7de2c712 gstdemux_init_stream+0x12() [Z:\home\julliard\wine\wine\dlls\winegstreamer\gstdemux.c:1389] in winegstreamer (0x0089fd18) 1 0x7de279a0 filter_Pause+0x4f(iface=<couldn't compute location>) [Z:\home\julliard\wine\wine\dlls\winegstreamer..\strmbase\filter.c:336] in winegstreamer (0x0089fd48) 2 0x0040fb49 func_avisplit+0x2688() [Z:\home\julliard\wine\wine\dlls\quartz\tests......\include\strmif.h:1905] in quartz_test (0x0089fe18) 3 0x00481d1a main+0x279(argc=<is not available>, argv=<is not available>) [Z:\home\julliard\wine\wine\dlls\quartz\tests......\include\wine\test.h:548] in quartz_test (0x0089fee8) 4 0x004813de mainCRTStartup+0x6d() [Z:\home\julliard\wine\wine\dlls\msvcrt\crt_main.c:59] in quartz_test (0x0089ff30) 5 0x7b453a92 call_process_entry+0x11() in kernel32 (0x0089ff48) 6 0x7b453eb0 start_process+0xdf(entry=<couldn't compute location>, peb=<couldn't compute location>) [Z:\home\julliard\wine\wine\dlls\kernel32\process.c:153] in kernel32 (0x0089ffd8) 7 0x7b453a9e __wine_start_process+0x9() in kernel32 (0x0089ffec) 0x7de2c712 gstdemux_init_stream+0x12 [Z:\home\julliard\wine\wine\dlls\winegstreamer\gstdemux.c:1389] in winegstreamer: movl 0x0(%eax),%esi 1389 const SourceSeeking *seeking = &filter->sources[0]->seek;
On 2/27/20 3:37 PM, Alexandre Julliard wrote:
Zebediah Figura z.figura12@gmail.com writes:
This fixes background music in Tomb Raider II.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
dlls/winegstreamer/gstdemux.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
This breaks the tests:
../../../tools/runtest -q -P wine -T ../../.. -M quartz.dll -p quartz_test.exe avisplit && touch avisplit.ok wine: Unhandled page fault on read access to 00000000 at address 7DE2C712 (thread 0040), starting debugger... Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7de2c712). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:7de2c712 ESP:0089fcf0 EBP:0089fd18 EFLAGS:00010206( R- -- I - -P- ) EAX:00000000 EBX:00e981e8 ECX:0089fd20 EDX:004a7afc ESI:00000000 EDI:00e981f8 Stack dump: 0x0089fcf0: 00000003 0089fd10 7eae1c80 0089fd20 0x0089fd00: 00e981e8 00000000 0089fd48 00e981e8 0x0089fd10: 00000000 00e981f8 0089fd48 7de279a0 0x0089fd20: 00e981e8 004837d0 0089fd58 0047a0bd 0x0089fd30: 00e981e8 00000000 0089fd60 00e981e8 0x0089fd40: 00000000 004837d0 0089fe18 0040fb49 Backtrace: =>0 0x7de2c712 gstdemux_init_stream+0x12() [Z:\home\julliard\wine\wine\dlls\winegstreamer\gstdemux.c:1389] in winegstreamer (0x0089fd18) 1 0x7de279a0 filter_Pause+0x4f(iface=<couldn't compute location>) [Z:\home\julliard\wine\wine\dlls\winegstreamer..\strmbase\filter.c:336] in winegstreamer (0x0089fd48) 2 0x0040fb49 func_avisplit+0x2688() [Z:\home\julliard\wine\wine\dlls\quartz\tests......\include\strmif.h:1905] in quartz_test (0x0089fe18) 3 0x00481d1a main+0x279(argc=<is not available>, argv=<is not available>) [Z:\home\julliard\wine\wine\dlls\quartz\tests......\include\wine\test.h:548] in quartz_test (0x0089fee8) 4 0x004813de mainCRTStartup+0x6d() [Z:\home\julliard\wine\wine\dlls\msvcrt\crt_main.c:59] in quartz_test (0x0089ff30) 5 0x7b453a92 call_process_entry+0x11() in kernel32 (0x0089ff48) 6 0x7b453eb0 start_process+0xdf(entry=<couldn't compute location>, peb=<couldn't compute location>) [Z:\home\julliard\wine\wine\dlls\kernel32\process.c:153] in kernel32 (0x0089ffd8) 7 0x7b453a9e __wine_start_process+0x9() in kernel32 (0x0089ffec) 0x7de2c712 gstdemux_init_stream+0x12 [Z:\home\julliard\wine\wine\dlls\winegstreamer\gstdemux.c:1389] in winegstreamer: movl 0x0(%eax),%esi 1389 const SourceSeeking *seeking = &filter->sources[0]->seek;
Thanks. Dumb mistake...
Fixes: 6745afd81d38e26b8890bd97163eb1e4494c6cb1 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gstdemux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 02bf69cacd9..3f06016f963 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -2068,7 +2068,9 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface, VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pin->pin.pin.mt.pbFormat; buffer_size = format->bmiHeader.biSizeImage; } - else if (IsEqualGUID(&pin->pin.pin.mt.formattype, &FORMAT_WaveFormatEx)) + else if (IsEqualGUID(&pin->pin.pin.mt.formattype, &FORMAT_WaveFormatEx) + && (IsEqualGUID(&pin->pin.pin.mt.subtype, &MEDIASUBTYPE_PCM) + || IsEqualGUID(&pin->pin.pin.mt.subtype, &MEDIASUBTYPE_IEEE_FLOAT))) { WAVEFORMATEX *format = (WAVEFORMATEX *)pin->pin.pin.mt.pbFormat; buffer_size = format->nAvgBytesPerSec;