[Bug 692368] VBR mp3 files - query position not accurate

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Jan 24 14:38:57 PST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=692368
  GStreamer | gst-plugins-ugly | 0.10.36

--- Comment #9 from Hans Oesterholt <hans at oesterholt.net> 2013-01-24 22:38:52 UTC ---
Thank you for your solution, however I run into some strange problems
(gstreamer ersion 0.10.36.0).

Whenever I do a non-flushing seek (after the first segment setting seek
(flushing or non flushing, it doesn't matter)), I get the following assertion
failing:

First seek: - output of banshee (including my own fprintf statements)

[1 Debug 23:35:19.973] State change: Playing
[1 Debug 23:35:19.973] Settting playing range to 63500 - 319100
bp_set_segment: begintime=63500,000000, endtime=319100,000000
Creating seek event (flush=1)
Sending seek event
Result=1

Second seek: 

[1 Debug 23:35:39.514] Got SegmentDone callback
[1 Debug 23:35:39.515] OnEventChanged:SegmentDone Playerstate=Playing
[1 Debug 23:35:39.515] Handling Segment Done event
[1 Debug 23:35:39.515] OnEventChanged:RequestNextTrack Playerstate=Playing
[1 Debug 23:35:39.519] Querying model for track to play in off:Next mode
[1 Debug 23:35:39.522] HandleNextTrack :System of a Down - 03 - Revenga (on
Mezmerize (2005)) <00:03:48.0200000>
[file:///home/hans/.banshee_cuesheets/c/d/title=03_-_Revenga%3Boffset=319100%3Bend_offset=547120.mp3]
[1 Debug 23:35:39.524] Handling cuesheet next
[1 Debug 23:35:39.544] OnEventChanged:EndOfStream Playerstate=Playing
[1 Debug 23:35:39.545] Track System of a Down - 02 - B.Y.O.B. (on Mezmerize
(2005)) <00:04:15.6000000>
[file:///home/hans/.banshee_cuesheets/5/9/title=02_-_B_Y_O_B_%3Boffset=63500%3Bend_offset=319100.mp3]
had playtime of 82422 msec (82sec), duration 255600 msec, queued: False
[1 Debug 23:35:39.546] OnEventChanged:StartOfStream Playerstate=Playing
[1 Debug 23:35:39.582] Settting playing range to 319100 - 547120
bp_set_segment: begintime=319100,000000, endtime=547120,000000
Creating seek event (flush=0)
Sending seek event

(Banshee:31010): GStreamer-CRITICAL **: gst_event_new_new_segment_full:
assertion `start <= stop' failed
Result=1
[1 Debug 23:35:39.582] OnEventChanged:Range Playerstate=Playing


Code of my seek routine:

P_INVOKE gboolean
bp_set_segment (BansheePlayer *player, guint64 time_ms, guint64
end_time_ms,gboolean accurate_seek,gboolean wait)
{
    g_return_val_if_fail (IS_BANSHEE_PLAYER (player), FALSE);

    //GstSeekFlags seek_flag = GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_SEGMENT;
    GstSeekFlags seek_flag = GST_SEEK_FLAG_SEGMENT; 
    if (!wait) {
        //seek_flag |= GST_SEEK_FLAG_FLUSH;
    }
    if (accurate_seek) {
        seek_flag |= GST_SEEK_FLAG_ACCURATE;
    }

    fprintf(stderr,"bp_set_segment: begintime=%lf, endtime=%lf\n",(double)
time_ms,(double) end_time_ms);

    /*if (player->playbin == NULL || !gst_element_seek (player->playbin, 1.0, 
        GST_FORMAT_TIME, seek_flag,
        GST_SEEK_TYPE_SET, time_ms * GST_MSECOND, 
        GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) {
        g_warning ("Could not seek in stream");
        return FALSE;
    }

    fprintf(stderr,"seeked\n");*/
    //seek_flag |= GST_SEEK_FLAG_SEGMENT;
    if (player->playbin == NULL) {
        g_warning("Could not seek in stream (playbin==null)");
        return FALSE;
    } else {
        GstEvent *event;
        fprintf(stderr,"Creating seek event (flush=%d)\n",!wait);
        event=gst_event_new_seek(1.0,GST_FORMAT_TIME,seek_flag,
                                GST_SEEK_TYPE_SET,time_ms*GST_MSECOND,
                                GST_SEEK_TYPE_SET,end_time_ms*GST_MSECOND
                                );
        fprintf(stderr,"Sending seek event\n");
        gboolean result=gst_element_send_event(player->playbin,event);
        fprintf(stderr,"Result=%d\n",result);
        if (!result) {
            g_warning("Could not seek in stream");
            return FALSE;
        } else {
            player->range_begin=(gint64) time_ms;
            player->range_end=(gint64) end_time_ms;
            return TRUE;
        }
    }

    /*
    gint64 etm=(wait) ? -1 : end_time_ms*GST_MSECOND; 

    if (player->playbin == NULL || !gst_element_seek (player->playbin, 1.0, 
        GST_FORMAT_TIME, seek_flag,
        GST_SEEK_TYPE_SET, time_ms * GST_MSECOND, 
        GST_SEEK_TYPE_SET, etm )) { // end_time_ms * GST_MSECOND)) {
        g_warning ("Could not seek in stream");
        return FALSE;
    }

    fprintf(stderr,"set segment\n");

    return TRUE;
    */
}

-- 
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