encoder: write audio in segments

I'll be honest, this probably makes no noticeable difference at all. It should be faster and more efficient, but whether that translates into any tangible improvement is yet to be seen.
This commit is contained in:
itsmattkc
2021-05-10 00:44:08 +10:00
parent 27653f10dc
commit 15556c64ae
12 changed files with 295 additions and 152 deletions
+7 -7
View File
@@ -67,21 +67,21 @@ AudioParams::Format FFmpegUtils::GetNativeSampleFormat(const AVSampleFormat &smp
return AudioParams::kFormatInvalid;
}
AVSampleFormat FFmpegUtils::GetFFmpegSampleFormat(const AudioParams::Format &smp_fmt)
AVSampleFormat FFmpegUtils::GetFFmpegSampleFormat(const AudioParams::Format &smp_fmt, bool planar)
{
switch (smp_fmt) {
case AudioParams::kFormatUnsigned8:
return AV_SAMPLE_FMT_U8;
return planar ? AV_SAMPLE_FMT_U8P : AV_SAMPLE_FMT_U8;
case AudioParams::kFormatSigned16:
return AV_SAMPLE_FMT_S16;
return planar ? AV_SAMPLE_FMT_S16P : AV_SAMPLE_FMT_S16;
case AudioParams::kFormatSigned32:
return AV_SAMPLE_FMT_S32;
return planar ? AV_SAMPLE_FMT_S32P : AV_SAMPLE_FMT_S32;
case AudioParams::kFormatSigned64:
return AV_SAMPLE_FMT_S64;
return planar ? AV_SAMPLE_FMT_S64P : AV_SAMPLE_FMT_S64;
case AudioParams::kFormatFloat32:
return AV_SAMPLE_FMT_FLT;
return planar ? AV_SAMPLE_FMT_FLTP : AV_SAMPLE_FMT_FLT;
case AudioParams::kFormatFloat64:
return AV_SAMPLE_FMT_DBL;
return planar ? AV_SAMPLE_FMT_DBLP : AV_SAMPLE_FMT_DBL;
case AudioParams::kFormatInvalid:
case AudioParams::kFormatCount:
break;