[Bug 768576] New base class for non-streaming audio formats such as module formats, SID music, MIDI files etc.

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Jul 11 13:36:41 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=768576

--- Comment #4 from Carlos Rafael Giani <dv at pseudoterminal.org> ---
I forgot about one open question with this base class : how to communicate the
list of subsongs to the user.

With old video game formats, one file (= one song) can have one or more
subsongs. Subsongs are subsections within the song, which are fully contained;
that is, you cannot just "play the big song", you always choose one subsong.

My original idea was to use GstToc to announce the list of available subsongs.
Entry types would be either TITLE or TRACK.

However, there are a few problems with GstToc for subsongs:

1) Subsongs may not have a defined length. Some formats do not have length
information, and may just end at some point. These would need support in
GstTock for entry length -1 (= GST_CLOCK_TIME_NONE). But -1 is currently
considered an invalid length.

2) As a variation of (1), they may loop internally without letting the outside
world know that looping is going on. In this case, all that can be done is to
either let it run indefinitely, or choose some arbitrary cutoff period (like, 5
minutes). Either way, the fact that this format loops internally would somehow
have to be communicated to the application.

3) Neither TITLE nor TRACK fully fit the definition of a subsong.

4) There is currently no way to accurately control the looping via GstToc.
GstNonstreamAudio not only allows for switching the looping on and off, it also
allows to set the exact number of loops (or set infinite looping), and supports
two looping modes: STEADY and LOOPING. In the STEADY mode, the playback
position will continue beyond the song's duration. So, a 5 minute song will
continue with positions 5:01, 5:02 ... after the first loop. LOOPING however
will do non-flushing seeks to actually stay within the duration. And, not all
formats support the LOOPING mode.


The fundamental problem I see is that GstToc just wasn't made for subsongs and
their characteristics. It was made mostly for CDs and DVDs. So, the other
option would be to create a new type of event, message, and type to communicate
subsong information to the application. This comes with its own list of issues,
most notably that applications would have to add explicit support for this
"subsong info type". On the other hand, applications would have to be aware of
the nature of subsongs anyway to be able to control them properly.

Opinions?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list