GNOME Bugzilla – Bug 140275
[gstplay] troubles with gst_play_location_set ()
Last modified: 2005-03-25 19:51:13 UTC
Hi all, hi have a little problem when I do a gst_play_location (); the next song doens't always (doesn't always +-= never) start well, it has a little gap at the begining. Looking at the ticks, for the second song the ticks starts sometimes at nearly 0.7-0.8 second, and stays at that value for may be 4-5 ticks (a tick is 200MS). This is when the song has a gap. To expose my problem you can try with a modified version of examples/gstplay/player.c with the patch attached Here is the ouput: tlg@portable gstplay $ ./player /home/tlg/Documents/Media/Rb/The_Verve/Urban_Hymns/01\ -\ Bitter_Sweet_Symphony.ogg /home/tlg/Documents/Media/Rb/Various/Trainspotting/13\ -\ Born_Slippy.ogg got video size 16, 16 serial: 321190394 title: Bitter Sweet Symphony artist: The Verve track number: 1 track count: 13 album: Urban Hymns comment: Ripped with Sound Juicer encoder: Xiph.Org libVorbis I 20030909 encoder version: 0 nominal bitrate: 192003 time tick 0.015692 got length 358440000000 time tick 0.215283 time tick 0.415283 time tick 0.616236 time tick 0.816236 time tick 1.016236 time tick 1.217188 time tick 1.417188 time tick 1.617143 time tick 1.817143 got length 0 time tick 0.000000 got video size 16, 16 serial: 1296857087 time tick 0.658741 title: Born Slippy artist: Underworld track number: 13 track count: 14 album: Trainspotting comment: Ripped with Sound Juicer encoder: Xiph.Org libVorbis I 20030909 encoder version: 0 nominal bitrate: 192003 time tick 0.658741 got length 584613333333 time tick 0.658741 time tick 0.658741 time tick 0.658741 time tick 0.808753 time tick 1.008753 time tick 1.209751 time tick 1.409751 time tick 1.609705 time tick 1.810703 time tick 2.010703 time tick 2.210658 time tick 2.411655 time tick 2.612608 time tick 2.814195 time tick 3.013878 Patch : --- examples/gstplay/player.c.old 2004-04-16 17:36:04.538329272 +0200 +++ examples/gstplay/player.c 2004-04-16 17:30:34.152555544 +0200 @@ -22,6 +22,7 @@ static GMainLoop *loop = NULL; static gint64 length = 0; +static char *nextsong; static void print_tag (const GstTagList * list, const gchar * tag, gpointer unused) @@ -85,7 +86,10 @@ static gboolean seek_timer (GstPlay * play) { - gst_play_seek_to_time (play, length / 2); + if (!gst_play_set_location (play, nextsong)) + g_warning ("Could not set location"); + gst_element_set_state (GST_ELEMENT (play), GST_STATE_PLAYING); + return FALSE; } @@ -106,8 +110,8 @@ /* Initing GStreamer library */ gst_init (&argc, &argv); - if (argc != 2) { - g_print ("usage: %s <video filename>\n", argv[0]); + if (argc != 3) { + g_print ("usage: %s <audio filename> <audio2 filename>\n", argv[0]); exit (-1); } @@ -167,7 +171,8 @@ g_error ("Could not set state to PLAYING"); g_idle_add ((GSourceFunc) idle_iterate, play); - g_timeout_add (20000, (GSourceFunc) seek_timer, play); + nextsong = argv[2]; + g_timeout_add (2000, (GSourceFunc) seek_timer, play); g_main_loop_run (loop);
That's related to autoplugging. This problem should go away when i ll implement decodebin and simplify the pipeline
hasn't gstplay been rewriten to use decodebin/playbin ? (isn't it already done ?) 2005-01-05 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * gst-libs/gst/play/play.c: (caps_set), (setup_size), (gst_play_tick_callback), (gst_play_change_state), (gst_play_dispose), (gst_play_init), (gst_play_class_init), (gst_play_set_location), (gst_play_get_location), (gst_play_seek_to_time), (gst_play_set_data_src), (gst_play_set_video_sink), (gst_play_set_audio_sink), (gst_play_set_visualization), (gst_play_connect_visualization), (gst_play_get_framerate), (gst_play_get_all_by_interface), (gst_play_new): Use playbin. Fixes #139749 and #147744.
*** This bug has been marked as a duplicate of 133778 ***