[FFmpeg-devel] New seeking API

Vladimir Pantelic pan
Wed Mar 11 20:30:51 CET 2009

Ivan Schreter wrote:

> BTW, I take it this new API will implicitly assume 
> "AVSEEK_FLAG_BACKWARD", since I cannot really imagine a reason why 
> someone would like to get a key frame _after_ the given timestamp/position.

Actually, I would. Given the timestamp "t_c" of the currently displayed 
video frame, going to the next key frame (seeking the minimum possible 
amount forward) would be done by
	...seek( ..., t_c, AVSEEK_FLAG_FORWARD );

Otherwise, I would have to use:

	...seek( ..., t_c + t_d, AVSEEK_FLAG_BACKWARD );

but how would I know how to chose t_d so that I do neither skip over one 
key frame nor seek back before t_c.

More information about the ffmpeg-devel mailing list