[gtk/matthiasc/for-master] video: Pause on unset too




commit 0ba56311004728c19e52831778c982e89a7a7278
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 2 00:06:41 2021 -0500

    video: Pause on unset too
    
    When new media stream is set on the GtkVideo
    widget and we're autoplaying, pause the old one.
    
    Otherwise, the music keeps playing unexpectedly.

 gtk/gtkvideo.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c
index 7eee5fd5ba..8258e25145 100644
--- a/gtk/gtkvideo.c
+++ b/gtk/gtkvideo.c
@@ -593,6 +593,8 @@ gtk_video_set_media_stream (GtkVideo       *self,
 
   if (self->media_stream)
     {
+      if (self->autoplay)
+        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]