In the unexpected case that an extractor seeked forward while we actually

asked to seek backwards, cause us to produce silence. This fixes some
occasionally very unpleasant noise after seeking.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38805 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-09-24 16:35:11 +00:00
parent 030345058e
commit a92abad742
1 changed files with 6 additions and 0 deletions

View File

@ -690,6 +690,12 @@ MediaTrackAudioSupplier::_SeekToKeyFrameBackward(int64& position)
position = currentPosition; position = currentPosition;
return B_OK; return B_OK;
} }
if (error == B_OK && position > wantedPosition) {
// We asked to seek backwards, but the extractor seeked
// forwards! Returning an error here will cause silence
// to be produced.
return B_ERROR;
}
if (error == B_OK) if (error == B_OK)
error = fMediaTrack->SeekToFrame(&position, 0); error = fMediaTrack->SeekToFrame(&position, 0);
if (error != B_OK) { if (error != B_OK) {