GstPlayTrickMode trick_mode;
gdouble rate;
+ gdouble start_position;
} GstPlay;
static gboolean quiet = FALSE;
static GstPlay *
play_new (gchar ** uris, const gchar * audio_sink, const gchar * video_sink,
gboolean gapless, gdouble initial_volume, gboolean verbose,
- const gchar * flags_string, gboolean use_playbin3)
+ const gchar * flags_string, gboolean use_playbin3, gdouble start_position)
{
GstElement *sink, *playbin;
GstPlay *play;
play->rate = 1.0;
play->trick_mode = GST_PLAY_TRICK_MODE_NONE;
-
+ play->start_position = start_position;
return play;
}
--play->cur_idx;
play_next (play);
}
+ if (play->start_position > 0.0) {
+ play_do_seek (play, play->start_position * GST_SECOND,
+ play->rate, play->trick_mode);
+ play->start_position = 0;
+ }
break;
case GST_MESSAGE_BUFFERING:{
gint percent;
gboolean gapless = FALSE;
gboolean shuffle = FALSE;
gdouble volume = -1;
+ gdouble start_position = 0;
gchar **filenames = NULL;
gchar *audio_sink = NULL;
gchar *video_sink = NULL;
N_("Disable interactive control via the keyboard"), NULL},
{"volume", 0, 0, G_OPTION_ARG_DOUBLE, &volume,
N_("Volume"), NULL},
+ {"start-position", 's', 0, G_OPTION_ARG_DOUBLE, &start_position,
+ N_("Start position in seconds."), NULL},
{"playlist", 0, 0, G_OPTION_ARG_FILENAME, &playlist_file,
N_("Playlist file containing input media files"), NULL},
{"instant-rate-changes", 'i', 0, G_OPTION_ARG_NONE, &instant_rate_changes,
/* prepare */
play = play_new (uris, audio_sink, video_sink, gapless, volume, verbose,
- flags, use_playbin3);
+ flags, use_playbin3, start_position);
if (play == NULL) {
gst_printerr