I have a playbin2 pipeline playing a video file with multiple tracks. I can change the currently playing track by setting the current-video
property:
current-video : Currently playing video stream (-1 = auto)
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1
However, once I set this, the video hangs and then eventually turns gray. The audio keeps playing. A coworker suggested that flushing the pipeline might fix it, but the only way to do that seems to be seeking to the current position with GST_SEEK_FLAG_FLUSH
. Using the seek does work, but it seems messy:
g_object_set(m_playBin, "current-video", video, NULL);
GstClockTime = getCurrentTime();
gst_element_seek(m_playBin, m_player->rate(),
GST_FORMAT_TIME,
(GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
GST_SEEK_TYPE_SET, clockTime,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)
Am I doing something wrong when I set the current-video
? Is there a simpler way to flush the pipeline?
Note: I'm using an Ogg Theora file for testing since it was easy to build, so I'm not sure if this problem shows up in other formats.