Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1575 closed enhancement (invalid)

Clarify docs that av_seek_frame() may possibly not seek by keyframe

Reported by: mbradshaw Owned by: stefano
Priority: normal Component: documentation
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

As a result of the discussion on the libav-user mailing list (particularly this reply), I learned that av_seek_frame() may not actually seek by keyframe for some files. The way the current documentation is ("Seek to the keyframe at timestamp.") it sounds like it will always seek to a keyframe, which implies the next packet read and fed into avcodec_decode_video2/audio4() will result in a complete frame, which of course is not the case if seeking by keyframe is not done.

This ticket is a request to simply expand on the existing documentation of av_seek_frame() and clarify that seeking may possibly not be done by keyframe (and any other gotchas that people might know that aren't documented with av_seek_frame()). I'd submit a patch myself but I seem to always get surprised with new gotchas when it comes to seeking, so I hope someone who is more familiar with av_seek_frame()'s behavior can better expound than I can.

Change History (3)

comment:1 by mbradshaw, 12 years ago

Actually, an alternative solution that would be acceptable to me would be to make av_seek_frame() return an error if AVSEEK_FLAG_ANY was not specified and the format doesn't support seeking by keyframe (like mpg).

comment:2 by mbradshaw, 12 years ago

Resolution: invalid
Status: newclosed

comment:3 by mbradshaw, 12 years ago

Closed as invalid in favor of #1607 (this isn't a problem with the docs, it's a problem with the demuxer breaking the seeking contract)

Note: See TracTickets for help on using tickets.