Skip to content

Commit

Permalink
Fix another crash when seeking audio
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Sep 1, 2013
1 parent df60d61 commit cca92ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/audiosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@ void FFMS_AudioSource::GetAudio(void *Buf, int64_t Start, int64_t Count) {
}
// Decode another block
else {
CacheIterator cachePos = it; --cachePos;

if (Start < CurrentSample && SeekOffset == -1)
throw FFMS_Exception(FFMS_ERROR_SEEKING, FFMS_ERROR_CODEC, "Audio stream is not seekable");

Expand Down Expand Up @@ -406,7 +404,8 @@ void FFMS_AudioSource::GetAudio(void *Buf, int64_t Start, int64_t Count) {
if (CurrentSample > Start)
throw FFMS_Exception(FFMS_ERROR_SEEKING, FFMS_ERROR_CODEC, "Seeking is severely broken");

it = cachePos;
// The block we want is now in the cache immediate before it
--it;
}
}
}
Expand Down

0 comments on commit cca92ad

Please sign in to comment.