[PATCH 4/7] winegstreamer: Check whether transform is supported when creating MPEG audio decoder.

Anton Baskanov baskanov at gmail.com
Tue May 3 13:28:02 CDT 2022


Signed-off-by: Anton Baskanov <baskanov at gmail.com>
---
 dlls/winegstreamer/quartz_transform.c | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c
index 375c549aad5..98953a5b47f 100644
--- a/dlls/winegstreamer/quartz_transform.c
+++ b/dlls/winegstreamer/quartz_transform.c
@@ -296,9 +296,37 @@ static const struct transform_ops mpeg_audio_codec_transform_ops =
 
 HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out)
 {
+    struct wg_format output_format =
+    {
+        .major_type = WG_MAJOR_TYPE_AUDIO,
+        .u.audio = {
+            .format = WG_AUDIO_FORMAT_S16LE,
+            .channel_mask = 1,
+            .channels = 1,
+            .rate = 44100,
+        },
+    };
+    struct wg_format input_format =
+    {
+        .major_type = WG_MAJOR_TYPE_MPEG1_AUDIO,
+        .u.mpeg1_audio = {
+            .layer = 2,
+            .rate = 44100,
+            .channels = 1,
+        },
+    };
+    struct wg_transform *transform;
     struct transform *object;
     HRESULT hr;
 
+    transform = wg_transform_create(&input_format, &output_format);
+    if (!transform)
+    {
+        FIXME("GStreamer doesn't support MPEG-1 audio decoding, please install appropriate plugins.\n");
+        return E_FAIL;
+    }
+    wg_transform_destroy(transform);
+
     hr = transform_create(outer, &CLSID_CMpegAudioCodec, &mpeg_audio_codec_transform_ops, &object);
     if (FAILED(hr))
         return hr;
-- 
2.34.1




More information about the wine-devel mailing list