Commit 4bfd42ba authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Use underlying stream access mode for bytestream capabilities.

parent b0951ba8
......@@ -2700,6 +2700,24 @@ static ULONG WINAPI bytestream_Release(IMFByteStream *iface)
return refcount;
}
static HRESULT WINAPI bytestream_stream_GetCapabilities(IMFByteStream *iface, DWORD *capabilities)
{
struct bytestream *stream = impl_from_IMFByteStream(iface);
STATSTG stat;
HRESULT hr;
TRACE("%p, %p.\n", iface, capabilities);
if (FAILED(hr = IStream_Stat(stream->stream, &stat, STATFLAG_NONAME)))
return hr;
*capabilities = MFBYTESTREAM_IS_READABLE | MFBYTESTREAM_IS_SEEKABLE;
if (stat.grfMode & (STGM_WRITE | STGM_READWRITE))
*capabilities |= MFBYTESTREAM_IS_WRITABLE;
return S_OK;
}
static HRESULT WINAPI bytestream_GetCapabilities(IMFByteStream *iface, DWORD *capabilities)
{
struct bytestream *stream = impl_from_IMFByteStream(iface);
......@@ -3060,7 +3078,7 @@ static const IMFByteStreamVtbl bytestream_stream_vtbl =
bytestream_QueryInterface,
bytestream_AddRef,
bytestream_Release,
bytestream_GetCapabilities,
bytestream_stream_GetCapabilities,
bytestream_stream_GetLength,
bytestream_stream_SetLength,
bytestream_stream_GetCurrentPosition,
......@@ -3252,7 +3270,6 @@ HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **byt
IStream_AddRef(object->stream);
position.QuadPart = 0;
IStream_Seek(object->stream, position, STREAM_SEEK_SET, NULL);
object->capabilities = MFBYTESTREAM_IS_READABLE | MFBYTESTREAM_IS_SEEKABLE;
*bytestream = &object->IMFByteStream_iface;
......
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