Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Up until now, vp9_raw_reorder was very conservative wrt the amount of frames it buffered internally: It held onto them for as long as possible and only output them when necessary, namely when a frame that is not yet completely output is about to leave the reference frame buffer or when a non-reference frame is encountered or when flushing at EOF. Now a fourth scenario in which to output frames has been added: When a frame that ought to be shown immediately (i.e. show_frame == 1) is encountered, one can already output the current frame and all frames preceding the current frame in decoding order as well as all outstanding show_existing_frame-frames corresponding to frames whose pts is < the pts of the new frame. This also provides a workaround for a bug in ffmpeg.c: If the copyinkf option is not used, then all non-keyframes preceding the second keyframe do not even reach the vp9_raw_reorder bsf: Because the first keyframe isn't immediately output, FFmpeg's counter of output frames is still zero after the first keyframe has been sent to the bsf, so that any further packet before the second keyframe is considered a leading non-keyframe to be dropped. Now vp9_raw_reorder outputs the first keyframe immediately in the common case that it is a show_frame. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
- Loading branch information