[Top][All Lists]

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

Re: [emms-help] mpv player alternative with json-ipc

From: Mike Kazantsev
Subject: Re: [emms-help] mpv player alternative with json-ipc
Date: Sat, 14 Apr 2018 00:00:14 +0500

On Fri, 13 Apr 2018 21:53:47 +0530
Pierre Neidhardt <address@hidden> wrote:

> Thanks for the hard work!
> Before merging dochang/emms-player-mpv, we also considered
> https://github.com/momomo5717/emms-player-simple-mpv which uses IPC as
> well.
> It turned out that there were many rough edges that needed polishing
> before merging.  So instead we opted for dochang's simpler version for
> now and we will adopt IPC features incrementally.
> I haven't looked at your code, but isn't it duplicating momomo5717's
> effort?

Didn't know about that implementation, though not sure why I missed it
when looking for mpv wrappers earlier.

But yeah, it seem to be implementing same IPC thing, though in a bit
different style using transaction queues.

Code there seem to be ~3x in size, which I guess is mostly due to tq
boilerplate and confirmed command deliverly, while my code just fires
these same as with --input-file= fifo and assigns common 
'(when err (message "emms-mpv-ipc-error: %s" (s-trim err))))'
handler to all of these, where user'd presumably just retry (when player
loads stream or whatever), same as with cli/osd inputs.

Oh well, guess if you need another idea for how thing can be wrapped,
there it is :)

> That said, it's no waste of effort and if you'd like to help merge the
> IPC features, you are very welcome!

Not sure if there's any gradual way to merge one implementation into
another, as with define-emms-simple-player you'd have simplier
process-per-track model, and replacing that with something like sending
commands to singleton "(emms-mpv-ipc)" (be it tq or async socket) pretty
much replaces the whole thing (which was rather simple to begin with).

Dunno about rough edges you've mentioned though - I'm kinda used to
writing code/protocols around async sockets (usually in python with
twisted/asyncio), so seemed to be rather simple protocol to me,
especially given how mpv can handle any commands at any time/state
without breaking, same as with --input-file= fire-and-forget fifo.

Will follow-up on that in a reply to Yoni's email, I guess.

Thanks for the feedback!
First time I've seen tq module used in the wild :)

Mike Kazantsev // fraggod.net

reply via email to

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