cast some lavc context variables to int (avoids warning treated as error when compiling WITH_FFMPEG on msvc)

Originally committed to SVN as r2137.
This commit is contained in:
Karl Blomster 2008-03-24 11:30:35 +00:00
parent 1b6fa7c9a6
commit 7be56fbcd4
2 changed files with 4 additions and 10 deletions

View file

@ -85,7 +85,7 @@ LAVCAudioProvider::LAVCAudioProvider(Aegisub::String _filename)
}
#endif
audStream = -1;
for (int i = 0; i < lavcfile->fctx->nb_streams; i++) {
for (int i = 0; i < (int)lavcfile->fctx->nb_streams; i++) {
codecContext = lavcfile->fctx->streams[i]->codec;
if (codecContext->codec_type == CODEC_TYPE_AUDIO) {
stream = lavcfile->fctx->streams[i];
@ -190,20 +190,14 @@ void LAVCAudioProvider::GetAudio(void *buf, int64_t start, int64_t count)
/* do we need to resample? */
if (rsct) {
/* if ((int64_t)(decoded_samples * resample_ratio / codecContext->channels) > samples_to_decode)
decoded_samples = (int64_t)(samples_to_decode / resample_ratio * codecContext->channels); */
/* what is the point of the above? if we ended up with more samples than we wanted,
we should do something about it, not pretend that everything's OK. -Fluff */
/* do the actual resampling */
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) */
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)"), (int)samples_to_decode, decoded_samples));
} else {
/* no resampling needed, just copy to the buffer */
/* if (decoded_samples > samples_to_decode)
decoded_samples = samples_to_decode; */
/* I do not understand the point of the above -Fluff */
/* no resampling needed, just copy to the buffer, but first make noise if we got an overflow */
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)"), (int)samples_to_decode, decoded_samples));

View file

@ -98,7 +98,7 @@ void LAVCVideoProvider::LoadVideo(Aegisub::String filename, double fps) {
// Find video stream
vidStream = -1;
codecContext = NULL;
for (int i=0;i<lavcfile->fctx->nb_streams;i++) {
for (int i=0; i < (int)lavcfile->fctx->nb_streams; i++) {
codecContext = lavcfile->fctx->streams[i]->codec;
if (codecContext->codec_type == CODEC_TYPE_VIDEO) {
stream = lavcfile->fctx->streams[i];