You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beets' bpd plugin should return integer values for the time field of the status command, and indeed this is what the code comments claim it is doing (from gstplayer.py#L170-L188):
deftime(self):
"""Returns a tuple containing (position, length) where both values are integers in seconds. If no stream is available, returns (0, 0). """fmt=Gst.Format(Gst.Format.TIME)
try:
posq=self.player.query_position(fmt)
ifnotposq[0]:
raiseQueryError("query_position failed")
pos=posq[1] / (10**9)
lengthq=self.player.query_duration(fmt)
ifnotlengthq[0]:
raiseQueryError("query_duration failed")
length=lengthq[1] / (10**9)
self.cached_time= (pos, length)
return (pos, length)
# ...
However this file has from __future__ import division, and both pos and length are the result of division operations, and so neither are integers. Any clients connecting to bpd's mpd server are getting values for status.time like 71.165973:97.893333333.
It turns out that most clients can cope with this just fine, but at least one crashes since it expects an integer. The mpd protocol does seem to require integers, at least that's what the reference implementation does.
The text was updated successfully, but these errors were encountered:
Thank you for pointing this out! Looks like we forgot to update the operators when we added from __future__ import division. Just pushed a fix in 958ad43.
Beets' bpd plugin should return integer values for the
time
field of thestatus
command, and indeed this is what the code comments claim it is doing (from gstplayer.py#L170-L188):However this file has
from __future__ import division
, and bothpos
andlength
are the result of division operations, and so neither are integers. Any clients connecting to bpd's mpd server are getting values forstatus.time
like71.165973:97.893333333
.It turns out that most clients can cope with this just fine, but at least one crashes since it expects an integer. The mpd protocol does seem to require integers, at least that's what the reference implementation does.
The text was updated successfully, but these errors were encountered: