taizilongxu / douban.fm

:radio: douban.fm based on Python
MIT License
786 stars 190 forks source link

use mpv & Support cache file #74

Closed quininer closed 9 years ago

quininer commented 9 years ago

使用 mpv 播放器,并且支持 缓存。 另外提醒一下更新 pip 里的包.. 有点老了。

taizilongxu commented 9 years ago

嗯嗯,问一下mpv和mplayer有什么大的差别吗

quininer commented 9 years ago

@taizilongxu 在mplayer的基础上有更多功能,比如缓存到文件。

taizilongxu commented 9 years ago

45 这个最好是兼容一下吧,有空的时候研究研究,mplayer也是有缓存文件的.

quininer commented 9 years ago

@taizilongxu 我以为mplayer只能缓存到内存呢。

Hexcles commented 9 years ago

This is what I was trying to do in #45. And in fact, I've done some ground work which has been merged, namely abstracting the player interface.

If we want mpv support, the correct way (and IMO, the only way) is to add a new Mpv module (as well as a detection mechanism to choose the correct player module), which can be derived from either base Player or Mplayer. Replacing mplayer with mpv is definitely not a good choice, since mpv is still not included in many distributions and much less popular than mplayer.

Yet when I was implementing that module, I ran into a serious problem: no slave mode any more! mpv deliberately removed slave mode support because it is considered as "broken". The so called "slave-broken" mode is so different from the mplayer slave mode, and is very likely to be removed in near future. mpv developers strongly disencourage to interact with mpv through stdio. The "correct way" is to make use of their JSON API (socket based).

In fact, even if you use "slave-broken", I don't see enough changes made to incorporate the difference between real slave mode and this broken slave mode. Some functions should be broken.

(Sorry I don't have Chinese support in my working computer.)

quininer commented 9 years ago

@Hexcles Yes, should use more elegant solution. I just want to quickly add cache function.