"Seek" not working, likely due to duration being detected improperly
PiyushAgarwal
piyush.agarwal at ll.mit.edu
Wed May 28 12:55:24 PDT 2014
Hi Cameron,
Did you make sure to set your pipeline to a Paused state? In the ready state
the QueryDuration returns -1 for me as well, but if I do it after the Paused
state it works fine.
The best place to query it is also when the AsyncDone message is received on
the pipeline message bus:
pipeline.Bus.Message += delegate(object bus, MessageArgs
margs)
{
Gst.Message message = margs.Message;
switch (message.Type)
{
case MessageType.AsyncDone:
pipeline.QueryPosition(Format.Time, out
currentTime);
commandList.Enqueue("current_position;" +
currentTime / 1000000000.0);
pipeline.QueryDuration(Format.Time, out
duration);
commandList.Enqueue("duration;" + duration /
1000000000.0);
State state, pending;
pipeline.GetState(out state, out pending, 60 *
5L);
break;
}
}
};
For seeking you could do something like:
public static bool Seek(long seekPosition)
{
return pipeline.SeekSimple(Format.Time, SeekFlags.Flush |
SeekFlags.Accurate, seekPosition);
}
Hope that helps!
Piyush
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Seek-not-working-likely-due-to-duration-being-detected-improperly-tp4667255p4667258.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list