Fix a bug that would occasionally cause an extra track to be skipped when a track ended. Fixes issue #1233

This commit is contained in:
David Sansome 2011-01-20 21:29:48 +00:00
parent be5eb7a9fb
commit ee06d779f2
1 changed files with 5 additions and 2 deletions

View File

@ -688,8 +688,11 @@ void GstEngine::timerEvent(QTimerEvent* e) {
}
// when at the end, kill the track if it didn't stop yet (probably a
// multisection media file)
if(current_position >= current_length) {
// multisection media file). We add 1 second onto the length during this
// check to allow for the fact that the length has been rounded down to
// the nearest second, and to stop us from occasionally stopping the
// stream just before it ends normally.
if(current_position >= current_length + 1000) {
EndOfStreamReached(current_pipeline_->has_next_valid_url());
}
}