[PATCH 0/1] MR6785: winegstreamer: Don't force codec data length for WMA.
This makes us be able to pass custom data in codec data buffer. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785
From: Ziqing Hui <zhui(a)codeweavers.com> This makes us be able to pass custom data in codec data buffer. --- dlls/winegstreamer/quartz_parser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 19b104d55df..474d82872d5 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -320,7 +320,7 @@ static bool amt_from_wg_format_audio_wma(AM_MEDIA_TYPE *mt, const struct wg_form return false; } - size = sizeof(WAVEFORMATEX) + codec_data_len; + size = sizeof(WAVEFORMATEX) + format->u.audio.codec_data_len; if (!(wave_format = CoTaskMemAlloc(size))) return false; memset(wave_format, 0, size); @@ -336,12 +336,13 @@ static bool amt_from_wg_format_audio_wma(AM_MEDIA_TYPE *mt, const struct wg_form wave_format->nAvgBytesPerSec = format->u.audio.bitrate / 8; wave_format->nBlockAlign = format->u.audio.block_align; wave_format->wBitsPerSample = format->u.audio.depth; - wave_format->cbSize = codec_data_len; + wave_format->cbSize = format->u.audio.codec_data_len; - if (format->u.audio.codec_data_len == codec_data_len) - memcpy(wave_format+1, format->u.audio.codec_data, format->u.audio.codec_data_len); - else + memcpy(wave_format + 1, format->u.audio.codec_data, format->u.audio.codec_data_len); + + if (format->u.audio.codec_data_len != codec_data_len) FIXME("Unexpected codec_data length; got %u, expected %lu\n", format->u.audio.codec_data_len, codec_data_len); + return true; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6785
What's the point of this? Is there a real format that has an unexpected size? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785#note_87099
On Tue Nov 12 05:35:15 2024 +0000, Elizabeth Figura wrote:
What's the point of this? Is there a real format that has an unexpected size? The point is it makes us be able to pass some custom data from wg_parser to front end. So that, from font end, we could know some extra information from back end. For example, in Proton, we can know a input stream is transcoded.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785#note_87101
On Tue Nov 12 05:35:15 2024 +0000, Ziqing Hui wrote:
The point is it makes us be able to pass some custom data from wg_parser to front end. So that, from font end, we could know some extra information from back end. For example, in Proton, we can know a input stream is transcoded. Another option is adding 2 new member custom_data/custom_data_size to wg_format struct.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785#note_87102
On Tue Nov 12 05:36:58 2024 +0000, Ziqing Hui wrote:
Another option is adding 2 new member custom_data/custom_data_size to wg_format struct. At least this MR is harmless I think, we don't need to restrict codec data size
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785#note_87103
On Tue Nov 12 05:40:18 2024 +0000, Ziqing Hui wrote:
At least this MR is harmless I think, we don't need to restrict codec data size In my opinion, we shouldn't change Wine like this for a Proton-specific hack. If Proton needs to pass this information it should be done in the Proton tree.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785#note_87239
This merge request was closed by Ziqing Hui. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6785
participants (3)
-
Elizabeth Figura (@zfigura) -
Ziqing Hui -
Ziqing Hui (@zhui)