[mythtv] [mythtv-commits] Ticket #7994: Clear the bookmark at the end of playback

Jim Stichnoth stichnot at gmail.com
Mon Feb 1 19:10:12 UTC 2010


On Mon, Feb 1, 2010 at 8:00 AM, Dan Wilga
<mythtv-dev2 at dwilga-linux1.amherst.edu> wrote:
> On 1/30/10 1:04 PM, Michael T. Dean wrote:
>>
>> I considered doing this when fixing
>> http://svn.mythtv.org/trac/ticket/7049 , but after much discussion with
>> various people, I was told that many users set "permanent" bookmarks on
>> certain files, so we leave the bookmark for them.  I've been told some
>> do this to ensure a specific preview pixmap and others do it because a
>> couple user start watching the show together, but they end up watching
>> the end separately, or ...
>
> Just to chime in with another scenario, suggesting why automatically
> deleting the bookmark at the end of a recording would be bad: I have
> bookmarks set at specific points in my kid's favorite shows, which he
> watches over and over again. Sometimes, we'll all leave the room and
> playback will stop only when it hits the end of the file. If the bookmark
> was deleted, that would get to be pretty annoying.

Here is what I learned about how the frontend deals with bookmarks
when exiting playback.  This is handled in TV::PrepareToExitPlayer().
Its second argument is "bool bookmark", specifying whether the
bookmark should be set.  PrepareToExitPlayer() is called from about 14
separate locations, and the value of the bookmark argument is pretty
haphazard.  This is somewhat mitigated by the fact that it leaves the
bookmark untouched if IsNearEnd() is true (which incidentally returns
true only for recordings and never for videos).

In my latest patch, I cleaned up these calls by changing the bookmark
argument to take 3 possible values: definitely set the bookmark, do
not touch the bookmark, or treat it according the the "Action on
playback exit" setting.  For the latter option, the bookmark is
modified if the setting is "Save position and exit", and unmodified
otherwise.  Almost all of the calls to PrepareToExitPlayer() in my
patch now use the latter option, except when "Save and exit" or "Exit
without saving" are selected from the OSD menu.

I also modified PrepareToExitPlayer() so that setting a bookmark near
the end is treated as clearing the bookmark.  And to make this work
for videos as well, I changed IsNearEnd() so that it can be called in
a way that treats videos the same as recordings.  (After posting the
new patch, I realized there's a cosmetic glitch in which clearing the
bookmark briefly flashes a "Bookmark cleared" OSD message before
exiting, but this would be easy to solve.)

> So, anyway, it sounds like the currently proposed solution will work just
> fine for me.

I guess that was just a long-winded way of agreeing with you. :)

Jim


More information about the mythtv-dev mailing list