<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 音頻同步 初步印象:播放的速度終于均勻了,不過感覺好快 話說,是按照視頻同步的方案增加的函數 增加的大函數都是audio做文件名的。期望在下一輪閱讀中再次分析 synchronize_audio ## 比較tutorial5 vs tutorial 6 結構有點亂 代碼增加的大致有: ###選擇同步的時鐘接口函數 新添加了 double get_video_clock(VideoState *is) ~~~ double get_video_clock(VideoState *is) { double delta; delta = (av_gettime() - is->video_current_pts_time) / 1000000.0; return is->video_current_pts + delta; } double get_external_clock(VideoState *is) { return av_gettime() / 1000000.0; } double get_master_clock(VideoState *is) { if(is->av_sync_type == AV_SYNC_VIDEO_MASTER) { return get_video_clock(is); } else if(is->av_sync_type == AV_SYNC_AUDIO_MASTER) { return get_audio_clock(is); } else { return get_external_clock(is); } } ~~~ ### 重點移植 synchronize_audio 第二是,添加了類似于尚一章同步視頻的函數:同步音頻,這個函數期望反復閱讀 鑒于重要性,分代碼展示和代碼分析兩端 ~~~ int synchronize_audio(VideoState *is, short *samples, int samples_size, double pts) { int n; double ref_clock; n = 2 * is->audio_st->codec->channels; if(is->av_sync_type != AV_SYNC_AUDIO_MASTER) { double diff, avg_diff; int wanted_size, min_size, max_size, nb_samples; ref_clock = get_master_clock(is); diff = get_audio_clock(is) - ref_clock; if(diff < AV_NOSYNC_THRESHOLD) { // accumulate the diffs is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum; if(is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {//涉及到一個公式 is->audio_diff_avg_count++; } else { avg_diff = is->audio_diff_cum * (1.0 - is->audio_diff_avg_coef); if(fabs(avg_diff) >= is->audio_diff_threshold) { wanted_size = samples_size + ((int)(diff * is->audio_st->codec->sample_rate) * n); min_size = samples_size * ((100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100); max_size = samples_size * ((100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100); if(wanted_size < min_size) { wanted_size = min_size; } else if (wanted_size > max_size) { wanted_size = max_size; } if(wanted_size < samples_size) { /* remove samples */ samples_size = wanted_size; } else if(wanted_size > samples_size) { uint8_t *samples_end, *q; int nb; /* add samples by copying final sample*/ nb = (samples_size - wanted_size); samples_end = (uint8_t *)samples + samples_size - n; q = samples_end + n; while(nb > 0) { memcpy(q, samples_end, n); q += n; nb -= n; } samples_size = wanted_size; } } } } else { /* difference is TOO big; reset diff stuff */ is->audio_diff_avg_count = 0; is->audio_diff_cum = 0; } } return samples_size; } ~~~ 下面用突出 顯示? 展示我認為代碼中的難點。 /* Add or subtract samples to get a better sync, return new audio buffer size */ int synchronize_audio(VideoState *is, short *samples, int samples_size, double pts) { int n; double ref_clock; n = 2 * is->audio_st->codec->channels; if(is->av_sync_type != AV_SYNC_AUDIO_MASTER) { double diff, avg_diff; int wanted_size, min_size, max_size, nb_samples; ref_clock = get_master_clock(is); diff = get_audio_clock(is) - ref_clock; if(diff < AV_NOSYNC_THRESHOLD) { // accumulate the diffs is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum; if(is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {//涉及到一個公式 is->audio_diff_avg_count++; } else { avg_diff = is->audio_diff_cum * (1.0 - is->audio_diff_avg_coef); //這一個函數都是理解的難點 if(fabs(avg_diff) >= is->audio_diff_threshold) { wanted_size = samples_size + ((int)(diff * is->audio_st->codec->sample_rate) * n); min_size = samples_size * ((100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100); max_size = samples_size * ((100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100); if(wanted_size < min_size) { wanted_size = min_size; } else if (wanted_size > max_size) { wanted_size = max_size; } if(wanted_size < samples_size) { /* remove samples */ samples_size = wanted_size; } else if(wanted_size > samples_size) { uint8_t *samples_end, *q; int nb; /* add samples by copying final sample*/ nb = (samples_size - wanted_size); samples_end = (uint8_t *)samples + samples_size - n; q = samples_end + n; while(nb > 0) { memcpy(q, samples_end, n); q += n; nb -= n; } samples_size = wanted_size; } } } } else { /* difference is TOO big; reset diff stuff */ is->audio_diff_avg_count = 0; is->audio_diff_cum = 0; } } return samples_size; } ### 變化最大的函數之audio_callback ~~~ void audio_callback(void *userdata, Uint8 *stream, int len) { VideoState *is = (VideoState *)userdata; int len1, audio_size; double pts; while(len > 0) { if(is->audio_buf_index >= is->audio_buf_size) { /* We have already sent all our data; get more */ audio_size = audio_decode_frame(is, is->audio_buf, sizeof(is->audio_buf), &pts); if(audio_size < 0) { /* If error, output silence */ is->audio_buf_size = 1024; memset(is->audio_buf, 0, is->audio_buf_size); } else { audio_size = synchronize_audio(is, (int16_t *)is->audio_buf, audio_size, pts); is->audio_buf_size = audio_size; } is->audio_buf_index = 0; } len1 = is->audio_buf_size - is->audio_buf_index; if(len1 > len) len1 = len; memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1); len -= len1; stream += len1; is->audio_buf_index += len1; } } ~~~ 以上是代碼,這里附帶兩個版本的callback函數的對比圖: ![](https://box.kancloud.cn/2016-02-22_56cae4b84da80.jpg) 可以看到終點修改的位置在解碼后的處理。尤其注意紅色的標示部分 對比視頻同步的代碼,主要在vedio_thread中。 ### 小結看代碼思路 音頻的入口,就是從回調函數看起,然后看到同步的函數 對比,視頻,視頻就是從線程看起,并且結合主函數的刷新定時器來看。 ## 代碼實踐 以下直接拿log分析:給出一次代碼運行過程產生的輸出,以后直接對應代碼 ~~~ Function: synchronize_audio(VideoState *, short *, int, double), diff=0.027000000000000000 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= 0.027000000000000000 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=0 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 //這是一輪音頻get 解碼播放 的過程,round 0,相同的過程將會持續到round 18,變化請看下面的注釋 //省略其中重復的18個 //這是第20次音頻取樣播放,20是認為設定的閾值(詳細見宏定義);此時計算avg_diff,【】【】其實就是執行的另外一條代碼覆蓋; //并且第一次【注意,這是第一次】進入休整樣本值的過程中,后續的代碼執行結果:表示我們想讓樣本變小?? Function: synchronize_audio(VideoState *, short *, int, double), diff=-13.566370441424555 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -13.573071923920748 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061, 【when】is->audio_diff_avg_count:20 >10 // Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size :-216580 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 ~~~ 初步印象:視頻放完了,音頻還沒有放完。 **表格一:**audio_size**(**synchronize_audio**返回的值)** 比較一下老代碼,這個值是多還是少? Todo:分析一下老版本的值多少? 可否從音頻的波特率上分析下,一共20個,20*480 <table border="1" cellspacing="0" cellpadding="7" width="569"><colgroup><col width="553"/></colgroup><tbody><tr><td valign="top" width="553"><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 4: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 8: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 12: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 16: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 20: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 24: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 28: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 32: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 36: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 40: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 44: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 48: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 52: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 56: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 60: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 64: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 68: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 72: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 76: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 80: Function: audio_callback(void *, unsigned char *, int),auido_size= 480</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 86: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 92: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 98: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 104: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 110: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 116: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 122: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 128: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 134: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 140: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left" style="margin-bottom:0cm"><span style="font-family:Times New Roman,serif"><span style="font-size:12px"><span lang="en-US">Line 146: Function: audio_callback(void *, unsigned char *, int),auido_size= 0</span></span></span></p><p lang="zh-CN" align="left"><br/></p></td></tr></tbody></table> ### 附件:完整的log分析記錄: Function: synchronize_audio(VideoState *, short *, int, double), diff=0.027000000000000000 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= 0.027000000000000000 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=0 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 //這是一輪音頻get解碼 播放 的過程,round 0,相同的過程將會持續到round 18,變化請看下面的注釋 Function: synchronize_audio(VideoState *, short *, int, double), diff=-0.14302037207122775 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -0.14300687207122775 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=1 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-0.33604274414245550 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -0.33611424757849112 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=2 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-0.50606311621368327 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -0.50623117333747247 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=3 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-0.67608448828491097 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -0.67633760387157971 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=4 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-10.821046860356137 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -10.821385029158073 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=5 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-10.991067232427365 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -10.996477924941944 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=6 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-11.173088604498595 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -11.178586843461066 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=7 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-11.343109976569822 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -11.348699269991553 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=8 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-11.565133348641048 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -11.570807698276043 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=9 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-11.735154720712277 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -11.740940124561416 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=10 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-11.905175092783505 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -11.911045562845786 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=11 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-12.076196464854734 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -12.082151987636157 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=12 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-12.277218836925961 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -12.283259912919778 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=13 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-12.447239208997187 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -12.453380838953647 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=14 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-12.639261581068416 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -12.645488271487892 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=15 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-12.856284953139644 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -12.862607697275388 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=16 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-13.028306325210870 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -13.034737629059508 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=17 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-13.225328697282098 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -13.231846066096628 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=18 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 Function: synchronize_audio(VideoState *, short *, int, double), diff=-13.396349069353327 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -13.402964992386377 Function: synchronize_audio(VideoState *, short *, int, double), audio_diff_avg_count=19 Function: audio_callback(void *, unsigned char *, int),auido_size= 480 //這是第20次音頻取樣播放,20是認為設定的閾值;此時計算avg_diff; //并且第一次【注意,這是第一次】進入休整樣本值的過程中,后續的代碼執行結果:表示我們想讓樣本變小?? Function: synchronize_audio(VideoState *, short *, int, double), diff=-13.566370441424555 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -13.573071923920748 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 // Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-216580 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-13.836396813495783 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -13.843183349457744 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-220902 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-14.106423185567010 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -14.113344777241739 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-225222 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-14.376449557638237 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -14.383506230026859 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-229542 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-14.646475929709466 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -14.653667682824478 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-233862 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-14.926503301780693 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -14.933830135622106 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-238344 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-15.196529673851920 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -15.203996588919731 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-242664 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-15.466556045923149 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -15.474158044217608 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-246984 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-15.736582417994377 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -15.744319497016486 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-251304 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-16.040610790065607 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -16.048482949814115 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-256168 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-16.310638162136833 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -16.318662403611739 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-260490 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-16.582664534208060 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -16.590823865409867 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-264842 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 Function: synchronize_audio(VideoState *, short *, int, double), diff=-16.868691906279288 Function: synchronize_audio(VideoState *, short *, int, double), // accumulate the diffs= -16.876987318211992 Function: synchronize_audio(VideoState *, short *, int, double), avg_diff=-9.2559631349317831e+061,【when】is->audio_diff_avg_count:20 >10 Function: synchronize_audio(VideoState *, short *, int, double), wanted_size < min_size:-269418 < 0 Function: synchronize_audio(VideoState *, short *, int, double), /* remove samples */ Function: audio_callback(void *, unsigned char *, int),auido_size= 0 ## 小結 算法很重要 實踐很重要 結合代碼覆蓋學習
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看