Skip to content

Commit

Permalink
audio: Add a TODO and some notes on duration handling
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcik committed Feb 1, 2016
1 parent eda91cf commit af43612
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions mopidy/audio/actor.py
Expand Up @@ -746,6 +746,7 @@ def set_value(tag, value):

# 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, ' ')
Expand Down
5 changes: 5 additions & 0 deletions mopidy/audio/scan.py
Expand Up @@ -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
Expand Down

0 comments on commit af43612

Please sign in to comment.