瀏覽代碼

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

huihui 4 年之前
父節點
當前提交
e39ab15c05
共有 1 個文件被更改,包括 2 次插入1 次删除
  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));