Merge lp:~vanvugt/totem/fix-1698282 into lp:~ubuntu-desktop/totem/ubuntu

Proposed by Daniel van Vugt
Status: Merged
Merged at revision: 258
Proposed branch: lp:~vanvugt/totem/fix-1698282
Merge into: lp:~ubuntu-desktop/totem/ubuntu
Diff against target: 69 lines (+49/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/fix-bvw_update_tags-performance.patch (+41/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~vanvugt/totem/fix-1698282
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Ubuntu Sponsors Team Pending
Review via email: mp+329292@code.launchpad.net

Commit message

Reduce CPU usage and stuttery playback

For some reason bvw_update_tags gets called constantly even when none are
changing. And each call seems to trigger a clutter scene graph update.
So totem was spending 20-25% of its time in g_signal_emit and below updating the clutter scene graph and GTK widgets. With this fix, totem's
CPU usage drops by about a fifth and playback is much smoother (although
still not perfect).

This fixes the totem portion of LP: #1698282 and LP: #1698270, although
both bugs also need work done in clutter before they can be declared fully
resolved.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Daniel

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2017-08-13 23:37:49 +0000
+++ debian/changelog 2017-08-21 08:19:49 +0000
@@ -1,3 +1,10 @@
1totem (3.25.90.1-0ubuntu2) UNRELEASED; urgency=medium
2
3 * bacon-video-widget.c: Reduce CPU usage and visible stuttering
4 (LP: #1698282 and LP: #1698270).
5
6 -- Daniel van Vugt <daniel.van.vugt@canonical.com> Mon, 21 Aug 2017 16:10:19 +0800
7
1totem (3.25.90.1-0ubuntu1) artful; urgency=medium8totem (3.25.90.1-0ubuntu1) artful; urgency=medium
29
3 * New upstream release10 * New upstream release
411
=== added file 'debian/patches/fix-bvw_update_tags-performance.patch'
--- debian/patches/fix-bvw_update_tags-performance.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-bvw_update_tags-performance.patch 2017-08-21 08:19:49 +0000
@@ -0,0 +1,41 @@
1Description: Reduce CPU usage and stuttery playback
2 For some reason bvw_update_tags gets called constantly even when none are
3 changing. And each call seems to trigger a clutter scene graph update.
4 So totem was spending 20-25% of its time in g_signal_emit and below updating
5 the clutter scene graph and GTK widgets. With this fix, totem's CPU usage
6 drops by about a fifth and playback is much smoother (although still not
7 perfect).
8 .
9 This fixes the totem portion of LP: #1698282 and LP: #1698270, although
10 both bugs also need work done in clutter before they can be declared fully
11 resolved.
12Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
13Bug-Ubuntu: https://bugs.launchpad.net/bugs/1698282
14Forwarded: yes
15Last-Update: 2017-08-21
16
17diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
18index a8a5dbae..5808bd92 100644
19--- a/src/backend/bacon-video-widget.c
20+++ b/src/backend/bacon-video-widget.c
21@@ -2063,12 +2063,15 @@ bvw_update_tags (BaconVideoWidget * bvw, GstTagList *tag_list, const gchar *type
22 GstTagList **cache = NULL;
23 GstTagList *result;
24
25- GST_DEBUG ("Tags: %" GST_PTR_FORMAT, tag_list);
26-
27 /* all tags (replace previous tags, title/artist/etc. might change
28 * in the middle of a stream, e.g. with radio streams) */
29 result = gst_tag_list_merge (bvw->priv->tagcache, tag_list,
30 GST_TAG_MERGE_REPLACE);
31+ if (gst_tag_list_is_equal (result, bvw->priv->tagcache)) {
32+ gst_tag_list_unref (result);
33+ return;
34+ }
35+ GST_DEBUG ("Tags: %" GST_PTR_FORMAT, tag_list);
36 if (bvw->priv->tagcache)
37 gst_tag_list_unref (bvw->priv->tagcache);
38 bvw->priv->tagcache = result;
39--
402.11.0
41
042
=== modified file 'debian/patches/series'
--- debian/patches/series 2017-08-13 23:27:59 +0000
+++ debian/patches/series 2017-08-21 08:19:49 +0000
@@ -7,3 +7,4 @@
70003-totem-movie-properties-Respect-gtk-dialogs-use-heade.patch70003-totem-movie-properties-Respect-gtk-dialogs-use-heade.patch
8ubuntu-make-zeitgeist-plugin-builtin.patch8ubuntu-make-zeitgeist-plugin-builtin.patch
9fix-lirc-detection.patch9fix-lirc-detection.patch
10fix-bvw_update_tags-performance.patch

Subscribers

People subscribed via source and target branches