Streams hold a reference to the source, but this reference should not be taken until `Start()` is called because freeing the media source depends on release in `Shutdown()` of the stream's reference to the source. We could create the streams in `media_source_create()` and take source refs for them in `Start()`, but that's potentially confusing and fragile.
Streams can persist after the media source is destroyed. In that case, they cannot access the source object and it should be released and set to null. Windows behaviour is to release references to the source in `Shutdown()`. If we don't do this and a buggy app were to leak a stream object, the media source object would also leak and `wg_parser_destroy()` would not be called.
--
v5: winegstreamer: Release stream references to the media source in Shutdown().
https://gitlab.winehq.org/wine/wine/-/merge_requests/6783
On Wed Nov 20 10:02:28 2024 +0000, Huw Davies wrote:
> @bernhardu, I'd requested access to your repo so that I could make some
> cosmetic changes to the commit.
Hello Huw, sorry, did not realize this needs an action from my side, just confirmed it now.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6787#note_88137
When source_enum_display_settings() fails to find a display mode because the index is out of range,
the index number in the log is always 0 because the same variable is decreased in the for loop to
find the display mode, giving the impression that it fails to find the first display mode.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6862