scanner: workaround for gstreamer not pushing tags before PREROLL
refer https://bugzilla.gnome.org/show_bug.cgi?id=763553
This commit is contained in:
parent
3c535409ad
commit
3183f43b18
@ -210,8 +210,11 @@ def _process(pipeline, timeout_ms):
|
|||||||
elif message.type == Gst.MessageType.EOS:
|
elif message.type == Gst.MessageType.EOS:
|
||||||
return tags, mime, have_audio
|
return tags, mime, have_audio
|
||||||
elif message.type == Gst.MessageType.ASYNC_DONE:
|
elif message.type == Gst.MessageType.ASYNC_DONE:
|
||||||
if message.src == pipeline:
|
if tags:
|
||||||
return tags, mime, have_audio
|
return tags, mime, have_audio
|
||||||
|
else:
|
||||||
|
# workaround for https://bugzilla.gnome.org/show_bug.cgi?id=763553:
|
||||||
|
pipeline.set_state(Gst.State.PLAYING)
|
||||||
elif message.type == Gst.MessageType.TAG:
|
elif message.type == Gst.MessageType.TAG:
|
||||||
taglist = message.parse_tag()
|
taglist = message.parse_tag()
|
||||||
# Note that this will only keep the last tag.
|
# Note that this will only keep the last tag.
|
||||||
@ -220,6 +223,9 @@ def _process(pipeline, timeout_ms):
|
|||||||
now = int(time.time() * 1000)
|
now = int(time.time() * 1000)
|
||||||
timeout -= now - previous
|
timeout -= now - previous
|
||||||
previous = now
|
previous = now
|
||||||
|
# workaround for https://bugzilla.gnome.org/show_bug.cgi?id=763553:
|
||||||
|
if tags:
|
||||||
|
pipeline.set_state(Gst.State.PAUSED)
|
||||||
|
|
||||||
raise exceptions.ScannerError('Timeout after %dms' % timeout_ms)
|
raise exceptions.ScannerError('Timeout after %dms' % timeout_ms)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user