Explorar o código

修复音频采样不对导致播放速度不正常的问题

huihui %!s(int64=4) %!d(string=hai) anos
pai
achega
e39ab15c05
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      module/VideoPlayer/src/VideoPlayer/VideoPlayer.cpp

+ 2 - 1
module/VideoPlayer/src/VideoPlayer/VideoPlayer.cpp

@@ -177,7 +177,8 @@ int VideoPlayer::openSDL()
     ///后期使用ffmpeg解码完音频后,需要重采样成和这个一样的格式,否则播放会有杂音
     SDL_AudioSpec wanted_spec, spec;
     int wanted_nb_channels = 2;
-    int samplerate = 44100;
+//    int samplerate = 44100;
+    int samplerate = out_sample_rate;
 
     wanted_spec.channels = wanted_nb_channels;
     wanted_spec.samples = FFMAX(512, 2 << av_log2(wanted_spec.freq / 30));