[gst-devel] Getting duration of the song.

John Doe gstmediaplayer at gmail.com
Tue Oct 14 15:11:49 CEST 2008


 I'm trying to find out the song's duration without playing the song.
 Thus can there get the length of song on PAUSED mode of pipeline?

 Using the example above:

 query = gst_query_new_duration (GST_FORMAT_TIME);
 res = gst_element_query (pipeline, query);
 if (res) {
   gint64 duration;
   gst_query_parse_duration (query, NULL, &duration);
   g_print ("duration = %"GST_TIME_FORMAT, GST_TIME_ARGS (duration));
 }
 gst_query_unref (query);

 The artist and the title information have been shown as needed.

 -JD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20081014/4863ce89/attachment.htm>


More information about the gstreamer-devel mailing list