From: Akihiro Sagawa sagawa.aki@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56485 --- dlls/quartz/tests/mpegsplit.c | 2 +- dlls/winegstreamer/quartz_parser.c | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index 86625e5f555..476edbfb530 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -2140,7 +2140,7 @@ static void test_video_read_position(void)
hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(testsource.read_position == total, "Got 0x%s, expected 0x%s.\n", wine_dbgstr_longlong(testsource.read_position), wine_dbgstr_longlong(total)); + ok(testsource.read_position == total, "Got 0x%s, expected 0x%s.\n", wine_dbgstr_longlong(testsource.read_position), wine_dbgstr_longlong(total));
IAsyncReader_Release(testsource.reader); IPin_Release(sink); diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 5cb86c1dd76..c27bea0aa93 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -2378,11 +2378,29 @@ static HRESULT mpeg_splitter_sink_get_media_type(struct strmbase_pin *pin, return S_OK; }
+static HRESULT mpeg_splitter_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *pmt) +{ + struct parser *filter = impl_from_strmbase_sink(iface); + HRESULT hr = parser_sink_connect(iface, peer, pmt); + + /* Seek the reader to the end. RE:D Cherish! depends on this. */ + if (SUCCEEDED(hr) + && IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_MPEG1System) + && IsEqualGUID(&pmt->majortype, &MEDIATYPE_Stream)) + { + LONGLONG file_size, unused; + IAsyncReader_Length(filter->reader, &file_size, &unused); + IAsyncReader_SyncRead(filter->reader, file_size, 0, NULL); + } + + return hr; +} + static const struct strmbase_sink_ops mpeg_splitter_sink_ops = { .base.pin_query_accept = mpeg_splitter_sink_query_accept, .base.pin_get_media_type = mpeg_splitter_sink_get_media_type, - .sink_connect = parser_sink_connect, + .sink_connect = mpeg_splitter_sink_connect, .sink_disconnect = parser_sink_disconnect, };