[Bug 647364] New: VGM files loop indefinately

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Apr 10 07:48:25 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=647364
  GStreamer | gst-plugins-bad | 0.10.21

           Summary: VGM files loop indefinately
    Classification: Platform
           Product: GStreamer
           Version: 0.10.21
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: mihai.draghicioiu at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Hi guys. I'm a fan of old video game music, and I was happy to find that
gstreamer supports playing back vgm files. Later I found that it also supports
other formats, via libgme. However, when playing back most songs, they end up
looping indefinately. The song length is reported correctly, but when the time
slider reaches the far right (in Totem and Rhythmbox), it stays there and the
song keeps looping. The structure of these songs is basically Intro+Loop.

My suggestion is to play the intro once and the loop twice. It seems that this
is what in_vgm.dll does (winamp).

To reproduce the bug, download some sample vgm music (
http://project2612.org/details.php?id=599 for example - but be sure to ungzip
the track from vgz to vgm), and play it in Totem or Rhythmbox.

Here is my suggested code fix. In ext/gme/gstgme.c, line 409, gme_track_ended()
is called. This function returns false for looping songs. Whether this is
correct or not, I don't know, but certainly, what can be done is:

instead of

if (gme_track_ended (gme->player)) {

use:

if (gme_track_ended (gme->player) || gme_tell(gme->player) * GST_MSECOND <
gme->intro_length + gme->loop_length * 2) {

and to set intro_length and loop_length, add two GstClockTime members to the
_GstGmeDec struct, and fill them in at gstgme.c:484 with:

  gme->intro_length =
      gst_util_uint64_scale_int (info->intro_length, GST_MSECOND, 1);
  gme->loop_length =
      gst_util_uint64_scale_int (info->loop_length, GST_MSECOND, 1);

I can provide a patch, if everyone agrees that looping the loop section twice
is the best idea. Basically what this does is make the song not too short and
not too long. It should work for most songs. More correct would be to have a
setting somewhere, but I wouldn't know how to code that.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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