mfplat: Use underlying stream access mode for bytestream capabilities.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b0951ba860
commit
4bfd42baff
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue