Update emit_data to return true if data was delivered.
This is probably not needed, but for the sake of correctnes it doesn't hurt.
This commit is contained in:
parent
0a96e5dccb
commit
f2b975cc37
@ -231,11 +231,14 @@ class Audio(pykka.ThreadingActor):
|
||||
|
||||
Note that the uri must be set to ``appsrc://`` for this to work.
|
||||
|
||||
Returns true if data was delivered.
|
||||
|
||||
:param buffer_: buffer to pass to appsrc
|
||||
:type buffer_: :class:`gst.Buffer`
|
||||
:rtype: boolean
|
||||
"""
|
||||
source = self._playbin.get_property('source')
|
||||
source.emit('push-buffer', buffer_)
|
||||
return source.emit('push-buffer', buffer_) == gst.FLOW_OK
|
||||
|
||||
def emit_end_of_stream(self):
|
||||
"""
|
||||
|
||||
@ -115,8 +115,10 @@ class SpotifySessionManager(process.BaseThread, PyspotifySessionManager):
|
||||
buffer_ = gst.Buffer(bytes(frames))
|
||||
buffer_.set_caps(gst.caps_from_string(capabilites))
|
||||
|
||||
self.audio.emit_data(buffer_)
|
||||
return num_frames
|
||||
if self.audio.emit_data(buffer_).get():
|
||||
return num_frames
|
||||
else:
|
||||
return 0
|
||||
|
||||
def play_token_lost(self, session):
|
||||
"""Callback used by pyspotify"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user