13
0

Fix mp3 export on big-endian systems

This commit is contained in:
Robin Gareus 2022-06-20 16:05:28 +02:00
parent df518cba3c
commit 0f2c3bf9c9
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -378,9 +378,15 @@ ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::CmdPip
char tmp[64];
argp[a++] = strdup(ffmpeg_exe.c_str());
argp[a++] = strdup ("-f");
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
argp[a++] = strdup ("f32le");
argp[a++] = strdup ("-acodec");
argp[a++] = strdup ("pcm_f32le");
#else
argp[a++] = strdup ("f32be");
argp[a++] = strdup ("-acodec");
argp[a++] = strdup ("pcm_f32be");
#endif
argp[a++] = strdup ("-ac");
snprintf (tmp, sizeof(tmp), "%d", channels);
argp[a++] = strdup (tmp);