Skip to content

Commit

Permalink
Adjust to API change in gst-python >= 1.18 (#1948)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybczak committed Dec 19, 2020
1 parent 9ae3520 commit ed48e8f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mopidy/audio/tags.py
Expand Up @@ -111,7 +111,14 @@ def _extract_buffer_data(buf):
success, info = mem.map(Gst.MapFlags.READ)
if not success:
return None
data = info.data
if isinstance(info.data, memoryview):
# We need to copy the data as the memoryview is released
# when we call mem.unmap()
data = bytes(info.data)
else:
# GStreamer Python bindings <= 1.16 return a copy of the
# data as bytes()
data = info.data
mem.unmap(info)
return data

Expand Down

0 comments on commit ed48e8f

Please sign in to comment.