Commit faef3faf authored by Brendan Long's avatar Brendan Long

Merge pull request #9 from cablelabs/added-seek-source-option

Issue seek (not just query duration) on the source if requested via seek...
parents 918b329b d6a7b6f7
......@@ -1708,13 +1708,37 @@ static gboolean perform_test_seek(CustomData* data, gint64 start_position, GstFo
}
// Initiate seek
if (!gst_element_seek (data->pipeline, rate,
format, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, start_position,
GST_SEEK_TYPE_NONE, stop_position))
if (g_seek_source)
{
g_printerr("%s - Problems seeking.\n", __FUNCTION__);
return FALSE;
if (g_source)
{
g_print("%s - Sending seek to source\n", __FUNCTION__);
if (!gst_element_seek (g_source, rate,
format, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, start_position,
GST_SEEK_TYPE_NONE, stop_position))
{
g_printerr("%s - Problems seeking.\n", __FUNCTION__);
return FALSE;
}
}
else
{
g_printerr("%s - Unable to seek on NULL source\n", __FUNCTION__);
return FALSE;
}
}
else
{
g_print("%s - Sending seek to pipeline\n", __FUNCTION__);
if (!gst_element_seek (data->pipeline, rate,
format, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, start_position,
GST_SEEK_TYPE_NONE, stop_position))
{
g_printerr("%s - Problems seeking.\n", __FUNCTION__);
return FALSE;
}
}
g_print("%s - Seeking on pipeline element complete\n", __FUNCTION__);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment