GNOME Bugzilla – Bug 518010
gnlfilesource has unexpected media-start behavior
Last modified: 2009-03-19 15:48:21 UTC
# In this program the first filesource plays the first two seconds of my audio # file (passed in the first argument) and the second plays the next two seconds. # The start time of the second filesource is 2, which means that it should start # right after the first filesource but it does not, it waits for 2 more seconds # and starts 4 seconds in. When I make the media-start property of the second # filesource 0, it does start right after the first filesource with not pause. # Of course it then plays the first two seconds of the file over again, rather # than the next two. #!/usr/bin/python import pygst pygst.require("0.10") import gst import gobject import sys def OnPad(comp, pad): convpad = compconvert.get_compatible_pad(pad, pad.get_caps()) pad.link(convpad) pipeline = gst.Pipeline() comp = gst.element_factory_make("gnlcomposition") pipeline.add(comp) comp.connect("pad-added", OnPad) compconvert = gst.element_factory_make("audioconvert") pipeline.add(compconvert) sink = gst.element_factory_make("alsasink") pipeline.add(sink) compconvert.link(sink) audio1 = gst.element_factory_make("gnlfilesource") comp.add(audio1) audio1.set_property("location", sys.argv[1]) audio1.set_property("start", 0 * gst.SECOND) audio1.set_property("duration", 2 * gst.SECOND) audio1.set_property("media-start", 0 * gst.SECOND) audio1.set_property("media-duration", 2 * gst.SECOND) audio2 = gst.element_factory_make("gnlfilesource") comp.add(audio2) audio2.set_property("location", sys.argv[1]) audio2.set_property("start", 2 * gst.SECOND) audio2.set_property("duration", 2 * gst.SECOND) audio2.set_property("media-start", 2 * gst.SECOND) audio2.set_property("media-duration", 2 * gst.SECOND) pipeline.set_state(gst.STATE_PLAYING) gobject.MainLoop().run()
This only happens with mp3 and ogg (and probably other compressed file formats I have discovered) It works fine with wav.
issue with gnlfilesource and segment-done. Marking as duplicate of #575972 *** This bug has been marked as a duplicate of 575972 ***