audio: Make buffer conversion work on older GStreamer installs
This commit is contained in:
parent
64a58e0662
commit
793e425314
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user