audio: Make buffer conversion work on older GStreamer installs

This commit is contained in:
Thomas Adamcik 2016-03-25 13:11:07 +01:00
parent 64a58e0662
commit 793e425314

View File

@ -70,13 +70,7 @@ def _extract_sample_data(sample):
buf = sample.get_buffer()
if not buf:
return None
found, mapinfo = buf.map(Gst.MapFlags.READ)
if not found:
return None
try:
return bytes(mapinfo.data)
finally:
buf.unmap(mapinfo)
return buf.extract_dup(0, buf.get_size())
# TODO: split based on "stream" and "track" based conversion? i.e. handle data