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.
This commit is contained in:
Matthias Clasen 2021-01-02 00:06:41 -05:00
parent c72589f0ee
commit 0ba5631100

View File

@ -593,6 +593,8 @@ gtk_video_set_media_stream (GtkVideo *self,
if (self->media_stream) if (self->media_stream)
{ {
if (self->autoplay)
gtk_media_stream_pause (self->media_stream);
g_signal_handlers_disconnect_by_func (self->media_stream, g_signal_handlers_disconnect_by_func (self->media_stream,
gtk_video_notify_cb, gtk_video_notify_cb,
self); self);