omg. stupidest bug ever. initialize bytes_per_sample

Originally committed to SVN as r336.
This commit is contained in:
David Lamparter 2006-04-14 23:14:47 +00:00
parent 1afe91f04f
commit 1f27325394
1 changed files with 1 additions and 1 deletions

View File

@ -81,6 +81,7 @@ LAVCAudioProvider::LAVCAudioProvider(wxString _filename, VideoProvider *vpro)
int setsample = Options.AsInt(_T("Audio Sample Rate")); int setsample = Options.AsInt(_T("Audio Sample Rate"));
num_samples = stream->duration / bytes_per_sample; num_samples = stream->duration / bytes_per_sample;
bytes_per_sample = 2;
if (setsample) { if (setsample) {
rsct = audio_resample_init(1, codecContext->channels, setsample, codecContext->sample_rate); rsct = audio_resample_init(1, codecContext->channels, setsample, codecContext->sample_rate);
sample_rate = setsample; sample_rate = setsample;
@ -91,7 +92,6 @@ LAVCAudioProvider::LAVCAudioProvider(wxString _filename, VideoProvider *vpro)
sample_rate = codecContext->sample_rate; sample_rate = codecContext->sample_rate;
channels = codecContext->channels; channels = codecContext->channels;
} }
bytes_per_sample = 2;
buffer = (int16_t *)malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE); buffer = (int16_t *)malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
if (!buffer) if (!buffer)