Patch by Attila Fidan.
Fixes: 9192b3b724d90788f7a1682b3f9eedb7bf363e22 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57294
From: Rémi Bernon rbernon@codeweavers.com
Patch by Attila Fidan.
Fixes: 9192b3b724d90788f7a1682b3f9eedb7bf363e22 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57294 --- dlls/winegstreamer/wg_media_type.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index a8b3f75ea28..09d8e313698 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -163,6 +163,18 @@ static void init_caps_from_wave_format_wma3(GstCaps *caps, const WMAUDIO3WAVEFOR gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->wfx.nAvgBytesPerSec * 8, NULL); }
+static void init_caps_from_wave_format_wma4(GstCaps *caps, const WMAUDIO3WAVEFORMAT *format, UINT32 format_size) +{ + init_caps_codec_data(caps, &format->wfx + 1, format->wfx.cbSize); + + gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); + gst_structure_set_name(gst_caps_get_structure(caps, 0), "audio/x-wma"); + gst_caps_set_simple(caps, "wmaversion", G_TYPE_INT, 4, NULL); + gst_caps_set_simple(caps, "block_align", G_TYPE_INT, format->wfx.nBlockAlign, NULL); + gst_caps_set_simple(caps, "depth", G_TYPE_INT, format->wfx.wBitsPerSample, NULL); + gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->wfx.nAvgBytesPerSec * 8, NULL); +} + static void init_caps_from_wave_format(GstCaps *caps, const GUID *subtype, const void *format, UINT32 format_size) { @@ -178,9 +190,10 @@ static void init_caps_from_wave_format(GstCaps *caps, const GUID *subtype, return init_caps_from_wave_format_wma1(caps, format, format_size); if (IsEqualGUID(subtype, &MFAudioFormat_WMAudioV8)) return init_caps_from_wave_format_wma2(caps, format, format_size); - if (IsEqualGUID(subtype, &MFAudioFormat_WMAudioV9) - || IsEqualGUID(subtype, &MFAudioFormat_WMAudio_Lossless)) + if (IsEqualGUID(subtype, &MFAudioFormat_WMAudioV9)) return init_caps_from_wave_format_wma3(caps, format, format_size); + if (IsEqualGUID(subtype, &MFAudioFormat_WMAudio_Lossless)) + return init_caps_from_wave_format_wma4(caps, format, format_size);
GST_FIXME("Unsupported subtype " WG_GUID_FORMAT, WG_GUID_ARGS(*subtype)); }
While this looks functional, I'm not a huge fan of having four near-copies of the same function. I'd rather add an int wmaversion argument to one of them, and delete the other three.