From add83a9a7d738c11abf9b4979cb997a42e39f827 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Tue, 16 Nov 2021 16:28:32 +0100 Subject: video: Always pause if media-stream changed When you have a `GtkVideo` that's already playing some file, then using `gtk_video_set_file()` (or `gtk_video_set_media_stream()`) will _not_ pause the old media stream if "autoplay" is not set. What happens, is that you then get a `GtkVideo` which is playing both sound from the old stream, as well as video and sound from the new one, which is quite confusing. when setting a new media-stream, we should just _always_ put the previous one to paused to prevent any confusion. --- gtk/gtkvideo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c index 22c232b53e..d32d54f2ee 100644 --- a/gtk/gtkvideo.c +++ b/gtk/gtkvideo.c @@ -615,8 +615,7 @@ gtk_video_set_media_stream (GtkVideo *self, if (self->media_stream) { - if (self->autoplay) - gtk_media_stream_pause (self->media_stream); + gtk_media_stream_pause (self->media_stream); g_signal_handlers_disconnect_by_func (self->media_stream, gtk_video_notify_cb, self); -- cgit v1.2.1