mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix sizes so that we don't write too far
This commit is contained in:
parent
54ae929b2f
commit
8d716452ba
|
@ -270,7 +270,7 @@ void CVideo::nextAudioFrame(void (*Mix)(short *pFinalOut, unsigned Frames))
|
|||
swr_get_delay(
|
||||
m_AudioStream.swr_ctx,
|
||||
m_AudioStream.enc->sample_rate
|
||||
) + m_AudioStream.tmp_frame->nb_samples * 2,
|
||||
) + m_AudioStream.tmp_frame->nb_samples,
|
||||
|
||||
m_AudioStream.enc->sample_rate,
|
||||
m_AudioStream.enc->sample_rate, AV_ROUND_UP
|
||||
|
@ -284,7 +284,7 @@ void CVideo::nextAudioFrame(void (*Mix)(short *pFinalOut, unsigned Frames))
|
|||
0, // pointer to linesize (int*)
|
||||
(const uint8_t*)m_aBuffer,
|
||||
2, // channels
|
||||
m_AudioStream.tmp_frame->nb_samples * 2,
|
||||
m_AudioStream.tmp_frame->nb_samples,
|
||||
AV_SAMPLE_FMT_S16,
|
||||
0 // align
|
||||
);
|
||||
|
@ -298,9 +298,9 @@ void CVideo::nextAudioFrame(void (*Mix)(short *pFinalOut, unsigned Frames))
|
|||
ret = swr_convert(
|
||||
m_AudioStream.swr_ctx,
|
||||
m_AudioStream.frame->data,
|
||||
m_AudioStream.frame->nb_samples * 2,
|
||||
m_AudioStream.frame->nb_samples,
|
||||
(const uint8_t **)m_AudioStream.tmp_frame->data,
|
||||
m_AudioStream.tmp_frame->nb_samples * 2
|
||||
m_AudioStream.tmp_frame->nb_samples
|
||||
);
|
||||
|
||||
if (ret < 0)
|
||||
|
|
Loading…
Reference in a new issue