summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <ndegraef@redhat.com>2021-11-16 16:28:32 +0100
committerNiels De Graef <ndegraef@redhat.com>2021-11-16 16:28:32 +0100
commitadd83a9a7d738c11abf9b4979cb997a42e39f827 (patch)
tree8a005b0e0525433859be418e913f42e36df14c69
parent3d77e526d6b76333ac066921ef42033bc6f0f33d (diff)
downloadgtk+-wip/nielsdg/always-pause-on-changed-media-stream.tar.gz
video: Always pause if media-stream changedwip/nielsdg/always-pause-on-changed-media-stream
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.
-rw-r--r--gtk/gtkvideo.c3
1 files changed, 1 insertions, 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);