Prior to 2537a2d Decoder::position() was not updated if a decoder emitted
authorCarl Hetherington <cth@carlh.net>
Fri, 2 Feb 2018 23:47:46 +0000 (23:47 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 2 Feb 2018 23:47:46 +0000 (23:47 +0000)
commit518be532a480173dfac962d5aca347a2388bb072
treef3b3450f1cc48ebf4c3784433c19bca984ef08a0
parente41c40521367885d1433ba53bc57c265237c7480
Prior to 2537a2d Decoder::position() was not updated if a decoder emitted
data which were ignored by the Player.

2537a2d changed this so that Decoder::position() is always updated, as it could
not see the point of the previous behaviour.

It now seems that the behaviour prior to 2537a2d fixed problems with cases like
remake_with_subtitle_test. With this test the FFmpeg content happens to emit
a final frame just after its end point with a gap before it.  Code prior to
2537a2d handled this by making sure that FFmpegDecoder::flush() filled the gap (it reads
VideoDecoder::position and fills the gap at the end of content accordingly).

This no longer works if VideoDecoder::position is updated to take into account
the emitted (and ignored) frame just after the end of the content.

This commit re-fixes that problem by a different means; Player::video now
fills the gaps in this case by more careful handling of received data which is
off the end of the content.
src/lib/player.cc