diff --git a/core/audio_provider.cpp b/core/audio_provider.cpp index 2249383ba..b4d15ea60 100644 --- a/core/audio_provider.cpp +++ b/core/audio_provider.cpp @@ -168,7 +168,7 @@ AudioProvider *AudioProvider::GetAudioProvider(wxString filename, AudioDisplay * // Select provider #ifdef __WINDOWS__ - provider = new AvisynthAudioProvider(filename); + //provider = new AvisynthAudioProvider(filename); #endif #ifdef USE_LAVC diff --git a/core/audio_provider_lavc.cpp b/core/audio_provider_lavc.cpp index 074dbcd8b..2d95a5e07 100644 --- a/core/audio_provider_lavc.cpp +++ b/core/audio_provider_lavc.cpp @@ -121,7 +121,11 @@ void LAVCAudioProvider::LoadAudio(wxString file) { result = avcodec_open(codecContext,codec); if (result < 0) throw _T("Failed to open audio decoder"); - // TODO: rest of opening + // Set variables + sample_rate = codecContext->sample_rate; + channels = codecContext->channels; + bytes_per_sample = 2; //codecContext->sample_fmt; + num_samples = stream->duration / bytes_per_sample; } // Catch errors @@ -154,4 +158,5 @@ void LAVCAudioProvider::Close() { // Get audio void LAVCAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) { // TODO + for (__int64 i=0;i