Commit 7c03bca5 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

winegstreamer: Seek to the end after MPEG splitter connection.

parent 3547dfc5
......@@ -2183,7 +2183,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);
......
......@@ -2380,11 +2380,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,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment