Seek to initial start time stalling without FLUSH
I'm trying to append buffer to a pipeline using GStreamer part way through a stream and start playback from a non-zero PTS position. My flow is roughly as follows :
- -Append buffer for Audio and Video stream using gst_app_src_push_buffer, starting with a video Key Frame.
- -Change the player to ready state
- -Seek the player (to the pts of the first appended keyframe) (with the GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT flags)
- -Start Playback
This does work to start playback, however because I seek with FLUSH, the already appended frames including the keyframe is now discarded and the video has corrupted video until the next keyframe is shown.
Every time I try seeking with ACCURATE to the key frame position, without GST_SEEK_FLAG_FLUSH, or with either of the SNAP flags the seek never completes. I've also tried seeking prior to the append, but that doesn't complete as well.
Is there a way to effectively seek the player without the FLUSH flag to maintain the buffer that was added in order to ready the player? Or to set the internal PTS time of GStreamer to the same position of the key frame without seeking?