Skip to content

Commit

Permalink
#849: fix useless "TypeError: can't convert return value to desired t…
Browse files Browse the repository at this point in the history
…ype" error message that comes out of nowhere: it seems that with py3k / gst1.x we have to return 0 explicitly from the signal handlers

git-svn-id: https://xpra.org/svn/Xpra/trunk@9501 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 23, 2015
1 parent 322060e commit a049ced
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/xpra/sound/sound_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def on_message(self, bus, message):
else:
log.info("unhandled bus message type %s: %s", t, message)
self.emit_info()
return 0

def parse_message0(self, message):
#message parsing code for GStreamer 0.10
Expand Down
13 changes: 7 additions & 6 deletions src/xpra/sound/src.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,32 +102,32 @@ def cleanup(self):
def on_new_preroll1(self, appsink):
sample = appsink.emit('pull-preroll')
log('new preroll1: %s', sample)
self.emit_buffer1(sample)
return self.emit_buffer1(sample)

def on_new_sample(self, bus):
#Gst 1.0
sample = self.sink.emit("pull-sample")
self.emit_buffer1(sample)
return self.emit_buffer1(sample)

def emit_buffer1(self, sample):
buf = sample.get_buffer()
#info = sample.get_info()
size = buf.get_size()
data = buf.extract_dup(0, size)
self.do_emit_buffer(data, {"timestamp" : normv(buf.pts),
return self.do_emit_buffer(data, {"timestamp" : normv(buf.pts),
"duration" : normv(buf.duration),
})


def on_new_preroll0(self, appsink):
buf = appsink.emit('pull-preroll')
log('new preroll0: %s bytes', len(buf))
self.emit_buffer0(buf)
return self.emit_buffer0(buf)

def on_new_buffer(self, bus):
#pygst 0.10
buf = self.sink.emit("pull-buffer")
self.emit_buffer0(buf)
return self.emit_buffer0(buf)


def emit_buffer0(self, buf, metadata={}):
Expand All @@ -139,7 +139,7 @@ def emit_buffer0(self, buf, metadata={}):
# "duration" : buf.duration,
# "offset" : buf.offset,
# "offset_end": buf.offset_end}
self.do_emit_buffer(buf.data, {
return self.do_emit_buffer(buf.data, {
"caps" : buf.get_caps().to_string(),
"timestamp" : normv(buf.timestamp),
"duration" : normv(buf.duration)
Expand All @@ -152,6 +152,7 @@ def do_emit_buffer(self, data, metadata={}):
metadata["time"] = int(time.time()*1000)
self.idle_emit("new-buffer", data, metadata)
self.emit_info()
return 0


gobject.type_register(SoundSource)
Expand Down

0 comments on commit a049ced

Please sign in to comment.