[gtk/wip/nielsdg/always-pause-on-changed-media-stream] video: Always pause if media-stream changed




commit add83a9a7d738c11abf9b4979cb997a42e39f827
Author: Niels De Graef <ndegraef redhat com>
Date:   Tue Nov 16 16:28:32 2021 +0100

    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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]