audio: Add a TODO and some notes on duration handling
This commit is contained in:
parent
eda91cfa96
commit
af43612630
@ -746,6 +746,7 @@ class Audio(pykka.ThreadingActor):
|
||||
|
||||
# Default to blank data to trick shoutcast into clearing any previous
|
||||
# values it might have.
|
||||
# TODO: Verify if this works at all, likely it doesn't.
|
||||
set_value(Gst.TAG_ARTIST, ' ')
|
||||
set_value(Gst.TAG_TITLE, ' ')
|
||||
set_value(Gst.TAG_ALBUM, ' ')
|
||||
|
||||
@ -137,6 +137,11 @@ def _start_pipeline(pipeline):
|
||||
|
||||
|
||||
def _query_duration(pipeline, timeout=100):
|
||||
# 1. Try and get a duration, return if success.
|
||||
# 2. Some formats need to play some buffers before duration is found.
|
||||
# 3. Wait for a duration change event.
|
||||
# 4. Try and get a duration again.
|
||||
|
||||
success, duration = pipeline.query_duration(Gst.Format.TIME)
|
||||
if success and duration >= 0:
|
||||
return duration // Gst.MSECOND
|
||||
|
||||
Loading…
Reference in New Issue
Block a user