Stop changing plane ptrs in rec. audio frames.

Stop setting the 4 plane data pointers in recording audio frames to the
sample stream. This confuses the converter and makes it write the right
channel to both channels.

- Fix #723.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2020-09-28 01:33:58 +00:00
parent 98b2fb6ebb
commit cb0933bf44
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 0 additions and 2 deletions

View File

@ -601,12 +601,10 @@ recording::MediaRet recording::MediaRecorder::AddFrame(const uint16_t *aud, int
int dst_nb_samples = av_rescale_rnd(swr_get_delay(swr, c->sample_rate) + audioframeTmp->nb_samples, c->sample_rate, c->sample_rate, AV_ROUND_UP);
av_assert0(dst_nb_samples == audioframeTmp->nb_samples);
audioframeTmp->data[3] = audioframeTmp->data[2] = audioframeTmp->data[1] = audioframeTmp->data[0];
if (swr_convert(swr, audioframe->data, audioframe->nb_samples, (const uint8_t **)audioframeTmp->data, audioframeTmp->nb_samples) < 0)
{
return MRET_ERR_RECORDING;
}
audioframe->data[3] = audioframe->data[2] = audioframe->data[1] = audioframe->data[0];
audioframe->pts = av_rescale_q(samplesCount, {1, c->sample_rate}, c->time_base);
samplesCount += dst_nb_samples;