[gst-devel] gst_segment_to_running_time with flacenc

Rod Begbie rodbegbie at gmail.com
Mon Mar 13 21:20:03 CET 2006


I'm converting my little Python CD ripper to GStreamer 0.10, and I'm
having trouble.

When I run it, it rips the first track OK, then dies with the following message:

GStreamer-CRITICAL **: gst_segment_to_running_time: assertion
`segment->format == format' failed
aborting...
Aborted


This only happens when I'm using flacenc to encode my music.  If I
just switch to "lame", everything works fine.

Below is the code I'm using (a mish-mash of some of the Python
examples, plus what I've discerned from the sound-juicer source).  Any
suggestions as to what's going wrong?

Thanks,

Rod.

def ripTrack(device, trackNo, filename, callbackProgress, callbackComplete):
    print "RIP %s" % trackNo
    cdp = gst.element_factory_make("cdparanoiasrc", "src")
    cdp.set_property("device", device)
    cdp.set_property("paranoia-mode", 4)
    cdp.set_property("track", trackNo)
#    src_pad = cdp.get_pad("src")

    queue = gst.element_factory_make("queue", "queue")
    queue.set_property("max-size-time", 120 * gst.SECOND)

    flac = gst.element_factory_make("flacenc", "encoder")

    sink = gst.element_factory_make("filesink", "sink")
    sink.set_property("location", filename)

    bin = gst.Pipeline()
    bin.add(cdp, queue, flac, sink)
    gst.element_link_many(cdp, queue, flac, sink)

    bin.set_state(gst.STATE_PAUSED)
    print bin.get_state(gst.CLOCK_TIME_NONE)

    bin.set_state(gst.STATE_PLAYING);

    print "GO"
    lastsecs = -1
    bus = bin.get_bus()
#    while 1:
    for x in range(60):
        print "TICK %d" % x
#        sleep(1)
        msg = bus.poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, gst.SECOND)
        print msg
        if msg:
            print "DUN"
            break

    print "STOP"
    bin.set_state(gst.STATE_NULL);
    callbackComplete(trackNo)
    print "VERYEND"


--
:: Rod Begbie :: http://groovymother.com/ ::




More information about the gstreamer-devel mailing list