fix catastrophic failure in last commit

Originally committed to SVN as r2116.
This commit is contained in:
Karl Blomster 2008-03-22 22:48:59 +00:00
parent e61d333297
commit b6d8b403d6
1 changed files with 2 additions and 2 deletions

View File

@ -197,14 +197,14 @@ void LAVCAudioProvider::GetAudio(void *buf, int64_t start, int64_t count)
decoded_samples = audio_resample(rsct, _buf, buffer, decoded_samples / codecContext->channels); decoded_samples = audio_resample(rsct, _buf, buffer, decoded_samples / codecContext->channels);
/* make some noise if we somehow ended up with more samples than we wanted (will cause audio skew) */ /* make some noise if we somehow ended up with more samples than we wanted (will cause audio skew) */
if (decoded_samples <= samples_to_decode) if (decoded_samples > samples_to_decode)
wxLogMessage(wxString::Format(_T("Warning: decoder output more samples than requested, audio skew highly likely! (Wanted %d, got %d)"), samples_to_decode, decoded_samples)); wxLogMessage(wxString::Format(_T("Warning: decoder output more samples than requested, audio skew highly likely! (Wanted %d, got %d)"), samples_to_decode, decoded_samples));
} else { } else {
/* no resampling needed, just copy to the buffer */ /* no resampling needed, just copy to the buffer */
/* if (decoded_samples > samples_to_decode) /* if (decoded_samples > samples_to_decode)
decoded_samples = samples_to_decode; */ decoded_samples = samples_to_decode; */
/* I do not understand the point of the above -Fluff */ /* I do not understand the point of the above -Fluff */
if (decoded_samples <= samples_to_decode) if (decoded_samples > samples_to_decode)
wxLogMessage(wxString::Format(_T("Warning: decoder output more samples than requested, audio skew highly likely! (Wanted %d, got %d)"), samples_to_decode, decoded_samples)); wxLogMessage(wxString::Format(_T("Warning: decoder output more samples than requested, audio skew highly likely! (Wanted %d, got %d)"), samples_to_decode, decoded_samples));
memcpy(_buf, buffer, temp_output_buffer_size); memcpy(_buf, buffer, temp_output_buffer_size);