emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recovering playback state of multiple playlists and over multiple se


From: Mike Kazantsev
Subject: Re: Recovering playback state of multiple playlists and over multiple sessions
Date: Tue, 19 Oct 2021 23:03:43 +0500

On Tue, 19 Oct 2021 07:24:14 +0500
Mike Kazantsev <mk.fraggod@gmail.com> wrote:

> On Tue, 19 Oct 2021 13:05:56 +1100
> Yuchen Pei <hi@ypei.me> wrote:
> 
> > > emms-bookmarks-add uses the emms-playing-time, which from some
> > > observatiosn seems totally different from the current timestamp 
> > > in 
> > > the track.
> > >
> > >  (emms-bookmarks-set (emms-playlist-current-selected-track) desc
> > >  emms-playing-time))    
> > 
> > I think I might know the problem here... emms-playing-time seems 
> > to be entirely controlled within emacs and not affected by what 
> > happens in the player (mpv in my case).  If I seek in mpv the 
> > emms-playing-time does not change at all.  Is there a way to pass 
> > back the playing time from the player to emms to make 
> > emms-playing-time or just emms-bookmark-add more accurate?  
> 
> Oh, right, with videos you do have an actual mpv player window which
> you control separately from emms.
...
> 
> There's also a common handler which emms-player-mpv uses
> (emms-player-mpv-event-handler), which I think might be worth updating
> to not re-fetch duration after seeks, but instead fetch/update playback
> position in emms like that.
> 
> Will probably do that tomorrow.

I've updated emms-player-mpv to handle this situation by updating
emms-playing-time upon receiving mpv "playback-restart" events, which
should follow seeks.

As you can also pause/unpause playback via window controls or hotkeys,
also added propagation of mpv "pause"/"unpause" events to emms playback
pausing/unpausing too.

This should hopefully address the situation where you've got 10h of
playback on 45m video, presumably because emms was counting time while
it was paused overnight or something like that.


I've also simplified updates of current track duration via mpv's
observe-property functionality, so that it'd push updates when
necessary, instead of requesting these from emms at any point.


These changes are implemented as recent 12f7d29 and ea6728d commits in
emms git repo, which I guess you can grab from there to test:

  https://git.savannah.gnu.org/cgit/emms.git/


It'd still be possible to do a lot of other things (anything really)
by interacting with mpv directly, all of which are probably unreasonable
to handle on emms side, but if you'll stumble upon some other common
interaction like ones above which can and probably should be reflected
in emms as well - let me know, might be easy to handle in the similar
fashion too.


Thanks for bringing the issue up and explaining the use-case in detail.


-- 
Mike Kazantsev // fraggod.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]