After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 452063 - Does not retain volume level between videos
Does not retain volume level between videos
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Browser plugin (obsolete)
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: totem-browser-maint
totem-browser-maint
: 359543 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-06-28 22:04 UTC by Sven Arvidsson
Modified: 2007-08-16 18:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sven Arvidsson 2007-06-28 22:04:08 UTC
[ Forwarded from http://bugs.debian.org/430467 ] 

"If I change the volume while watching a video, then go to another page and watch another video, the volume is reset to its original level.  It wish it would retain the level I set it to."
Comment 1 Bastien Nocera 2007-06-28 22:07:26 UTC
Known bug, as we currently just kill the viewer, which doesn't get a chance to save its state.
Comment 2 Bastien Nocera 2007-08-15 16:29:12 UTC
2007-08-15  Bastien Nocera  <hadess@hadess.net>

        * browser-plugin/org_gnome_totem_PluginViewer.xml:
        * browser-plugin/totem-plugin-viewer.c:
        (totem_embedded_save_state):
        * browser-plugin/totemPlugin.cpp: Call SaveState just before
        killing the plugin, so that it can save some details (such as the
        volume), does nothing yet though (Helps: #452063)


Just need to write the 3 lines of code to save the volume now.
Comment 3 Christian Persch 2007-08-15 20:45:17 UTC
Does the function on the plugin side actually get called? dbus_g_proxy_call_with_timeout invokes the method async when the programme returns to the mainloop, and by that time we'll already have killed the viewer...
(Note that I'm NOT advocating using sync method invocation!)
Comment 4 Bastien Nocera 2007-08-15 21:01:30 UTC
(In reply to comment #3)
> Does the function on the plugin side actually get called?
> dbus_g_proxy_call_with_timeout invokes the method async when the programme
> returns to the mainloop, and by that time we'll already have killed the
> viewer...

It did in my (short) tests. I was hoping it was a sync method for which we'd keep a _short_ timeout. The downside being that it might hang if the program hangs for whatever reason, but it's only for a very short time.

> (Note that I'm NOT advocating using sync method invocation!)

It's either that or updating gconf each time the volume is changed. What do you think is best?
Comment 5 Christian Persch 2007-08-15 22:53:47 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Does the function on the plugin side actually get called?
> > dbus_g_proxy_call_with_timeout invokes the method async when the programme
> > returns to the mainloop, and by that time we'll already have killed the
> > viewer...
> 
> It did in my (short) tests. I was hoping it was a sync method for which we'd
> keep a _short_ timeout. The downside being that it might hang if the program
> hangs for whatever reason, but it's only for a very short time.

Actually you're right, it's sync. I was looking at the wrong function in the API docs. That explains that it's actually calling the remote method.

We really shouldn't be running a recursive mainloop from plugin code. I didn't rewrite the whole plugin to be async for nothing :)

It will hang the programme for 1) a short time _per plugin_ (there may be many many plugins on the page), 2) is a security hole (you don't push a null JS context on the stack), and 3) will cause the weirdest crashes.

> It's either that or updating gconf each time the volume is changed. What do you
> think is best?

In that case, update the gconf key when the volume changes. 

Or alternatively, don't kill the viewer, and just invoke a "quit" method? (That might fail however if the whole browser is quitting and thus we never enter the mainloop again to send the method invocation.)
Comment 6 Bastien Nocera 2007-08-15 23:29:05 UTC
I'll revert and go with the GConf changes then.
Comment 7 Bastien Nocera 2007-08-16 08:59:43 UTC
2007-08-16  Bastien Nocera  <hadess@hadess.net>

        * browser-plugin/org_gnome_totem_PluginViewer.xml:
        * browser-plugin/totem-plugin-viewer.c:
        (totem_embedded_save_volume), (property_notify_cb_volume):
        * browser-plugin/totemPlugin.cpp: Revert "SaveState" patch
        and save the volume in GConf as soon as it's changed in the
        UI (Closes: #452063)
Comment 8 Bastien Nocera 2007-08-16 18:54:22 UTC
*** Bug 359543 has been marked as a duplicate of this bug. ***