track = ctx->track + i;
if (track->duration) {
int64_t track_size = 0;
- unsigned j;
+ unsigned j;
for (j = 0; j < track->num_chunks; ++j)
track_size += track->chunk_table[j].size;
track->avgBitrate =
m4af_writer_t *ctx = *ctxp;
m4af_track_t *track;
for (i = 0; i < ctx->num_tracks; ++i) {
- track = ctx->track + i;
- if (track->decSpecificInfo)
- m4af_free(track->decSpecificInfo);
- if (track->sample_table)
- m4af_free(track->sample_table);
- if (track->chunk_table)
- m4af_free(track->chunk_table);
- if (track->chunk_buffer)
- m4af_free(track->chunk_buffer);
+ track = ctx->track + i;
+ if (track->decSpecificInfo)
+ m4af_free(track->decSpecificInfo);
+ if (track->sample_table)
+ m4af_free(track->sample_table);
+ if (track->chunk_table)
+ m4af_free(track->chunk_table);
+ if (track->chunk_buffer)
+ m4af_free(track->chunk_buffer);
}
if (ctx->itmf_table)
m4af_free_itmf_table(ctx);
if (!params.transport_format) {
uint32_t scale;
unsigned framelen = aacinfo.frameLength;
- int sbr_mode = aacenc_is_sbr_active((aacenc_param_t*)¶ms);
- int sig_mode = aacEncoder_GetParam(encoder, AACENC_SIGNALING_MODE);
- if (sbr_mode && !sig_mode)
- downsampled_timescale = 1;
+ int sbr_mode = aacenc_is_sbr_active((aacenc_param_t*)¶ms);
+ int sig_mode = aacEncoder_GetParam(encoder, AACENC_SIGNALING_MODE);
+ if (sbr_mode && !sig_mode)
+ downsampled_timescale = 1;
scale = sample_format->sample_rate >> downsampled_timescale;
if ((m4af = m4af_create(M4AF_CODEC_MP4A, scale, &m4af_io, ofp)) < 0)
goto END;
goto END;
if (m4af) {
uint32_t delay = aacinfo.encoderDelay;
- int64_t frames_read = wav_get_position(wavf);
+ int64_t frames_read = wav_get_position(wavf);
uint32_t padding = frame_count * aacinfo.frameLength
- frames_read - aacinfo.encoderDelay;
m4af_set_priming(m4af, 0, delay >> downsampled_timescale,