Added frames per packet export

This commit is contained in:
DataHoarder 2022-04-20 22:37:27 +02:00
parent bb7e91682e
commit eec1c7d041
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
2 changed files with 4 additions and 1 deletions

View file

@ -21,6 +21,7 @@ alac_encoder alac_encoder_new(int sampleRate, int channels, int bitDepth, int fa
encoder.input_packet_size = 0;
encoder.output_max_packet_size = 0;
encoder.magic_cookie_size = 0;
encoder.frames_per_packet = 0;
AudioFormatDescription d;
d.mFormatID = kALACFormatAppleLossless;
@ -69,6 +70,7 @@ alac_encoder alac_encoder_new(int sampleRate, int channels, int bitDepth, int fa
encoder.input_packet_size = channels * (bitDepth >> 3) * d.mFramesPerPacket;
encoder.output_max_packet_size = encoder.input_packet_size + kALACMaxEscapeHeaderBytes;
encoder.magic_cookie_size = e->GetMagicCookieSize(channels);
encoder.frames_per_packet = d.mFramesPerPacket;
return encoder;
}
@ -150,4 +152,4 @@ int alac_encoder_write(alac_encoder* encoder, const unsigned char * input, int i
void alac_encoder_delete(alac_encoder* encoder){
delete reinterpret_cast<ALACEncoder*>(encoder->ptr);
encoder->ptr = nullptr;
}
}

View file

@ -11,6 +11,7 @@ typedef struct {
int input_packet_size;
int output_max_packet_size;
int magic_cookie_size;
int frames_per_packet;
} alac_encoder;
alac_encoder alac_encoder_new(int sampleRate, int channels, int bitDepth, int fastMode);