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

Subscribers

People subscribed via source and target branches