mfplat: Set origin name attribute for stream based bytestreams too.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-12-03 14:13:12 +03:00 committed by Alexandre Julliard
parent 4bfd42baff
commit d03cf6ceaa
1 changed files with 11 additions and 0 deletions

View File

@ -3245,6 +3245,7 @@ HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **byt
{
struct bytestream *object;
LARGE_INTEGER position;
STATSTG stat;
HRESULT hr;
TRACE("%p, %p.\n", stream, bytestream);
@ -3271,6 +3272,16 @@ HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **byt
position.QuadPart = 0;
IStream_Seek(object->stream, position, STREAM_SEEK_SET, NULL);
if (SUCCEEDED(IStream_Stat(object->stream, &stat, 0)))
{
if (stat.pwcsName)
{
IMFAttributes_SetString(&object->attributes.IMFAttributes_iface, &MF_BYTESTREAM_ORIGIN_NAME,
stat.pwcsName);
CoTaskMemFree(stat.pwcsName);
}
}
*bytestream = &object->IMFByteStream_iface;
return S_OK;