Browse Source

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

huihui 4 years ago
parent
commit
e39ab15c05
1 changed files with 2 additions and 1 deletions
  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));