Simulate a successful stream playback so that apps don't get stuck when trying to play a media file using the DirectShow api.
Signed-off-by: Anastasios Simeonidis symeonidis@csd.auth.gr --- dlls/amstream/mediastream.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c index bc61597502..633ba91591 100644 --- a/dlls/amstream/mediastream.c +++ b/dlls/amstream/mediastream.c @@ -1196,6 +1196,8 @@ typedef struct { IMediaStream *parent; IDirectDrawSurface *surface; RECT rect; + // FIXME: Implement IDirectDrawStreamSampleImpl_Update. + int workaround; } IDirectDrawStreamSampleImpl;
static inline IDirectDrawStreamSampleImpl *impl_from_IDirectDrawStreamSample(IDirectDrawStreamSample *iface) @@ -1279,9 +1281,15 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetSampleTimes(IDirectDrawStre static HRESULT WINAPI IDirectDrawStreamSampleImpl_Update(IDirectDrawStreamSample *iface, DWORD flags, HANDLE event, PAPCFUNC func_APC, DWORD APC_data) { + IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); + FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data);
- return S_OK; + // Simulate successful playback. + int count = (This->workaround + 1) % 300; + This->workaround = count; + + return (count == 299) ? MS_S_ENDOFSTREAM : S_OK; }
static HRESULT WINAPI IDirectDrawStreamSampleImpl_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds) @@ -1404,8 +1412,9 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD SetRect(&object->rect, 0, 0, desc.dwWidth, desc.dwHeight); }
- *ddraw_stream_sample = &object->IDirectDrawStreamSample_iface; + object->workaround = 0;
+ *ddraw_stream_sample = &object->IDirectDrawStreamSample_iface; return S_OK; }
On 12/02/2018 06:55 AM, Anastasios Simeonidis wrote:
Simulate a successful stream playback so that apps don't get stuck when trying to play a media file using the DirectShow api.
Signed-off-by: Anastasios Simeonidis symeonidis@csd.auth.gr
dlls/amstream/mediastream.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
This is very ugly; if returning MS_S_ENDOFSTREAM is really going to break Runaway demo then this function deserves a proper implementation, with tests.