Nikolay Sivov : mfreadwrite: Forward remaining indices in GetPresentationAttribute() to stream descriptors.

Alexandre Julliard julliard at winehq.org
Wed Mar 20 17:09:12 CDT 2019


Module: wine
Branch: master
Commit: ca84c6e82e4937e757bbc0bf11a09439fa920d1e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ca84c6e82e4937e757bbc0bf11a09439fa920d1e

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Mar 20 08:35:42 2019 +0300

mfreadwrite: Forward remaining indices in GetPresentationAttribute() to stream descriptors.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfreadwrite/main.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c
index 6b8989c..ef9e06e 100644
--- a/dlls/mfreadwrite/main.c
+++ b/dlls/mfreadwrite/main.c
@@ -423,6 +423,8 @@ static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface
         REFGUID guid, PROPVARIANT *value)
 {
     struct source_reader *reader = impl_from_IMFSourceReader(iface);
+    IMFStreamDescriptor *sd;
+    BOOL selected;
     HRESULT hr;
 
     TRACE("%p, %#x, %s, %p.\n", iface, index, debugstr_guid(guid), value);
@@ -446,12 +448,23 @@ static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface
                 return IMFPresentationDescriptor_GetItem(reader->descriptor, guid, value);
             }
             break;
+        case MF_SOURCE_READER_FIRST_VIDEO_STREAM:
+            index = reader->first_video_stream_index;
+            break;
+        case MF_SOURCE_READER_FIRST_AUDIO_STREAM:
+            index = reader->first_audio_stream_index;
+            break;
         default:
-            FIXME("Unsupported index %#x.\n", index);
-            return E_NOTIMPL;
+            ;
     }
 
-    return E_NOTIMPL;
+    if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(reader->descriptor, index, &selected, &sd)))
+        return hr;
+
+    hr = IMFStreamDescriptor_GetItem(sd, guid, value);
+    IMFStreamDescriptor_Release(sd);
+
+    return hr;
 }
 
 struct IMFSourceReaderVtbl srcreader_vtbl =




More information about the wine-cvs mailing list