Commit ca91b230 authored by Linshizhi's avatar Linshizhi

cleanup bug fix

parent 2401d0dc
......@@ -111,7 +111,7 @@ int audioMixArbitary(int numOfAudios, AudioFile *files[], AudioFile *o_file) {
for (int i = 0; i < numOfAudios; ++i) {
audio_ctx[i] = open_audio_file(files[i]);
if (audio_ctx[i] == NULL) {
printf("Failed to open audio file: %s", files[i]->filepath);
printf("Failed to open audio file: %s\n", files[i]->filepath);
goto FAIL;
}
}
......@@ -142,12 +142,16 @@ int audioMixArbitary(int numOfAudios, AudioFile *files[], AudioFile *o_file) {
err = 1;
CLEANUP:
audioStreamCtx_Release_free(&output_ctx);
if (output_ctx)
audioStreamCtx_Release_free(&output_ctx);
for (int i = 0; i < numOfAudios; ++i) {
audioStreamCtx_Release_free(&audio_ctx[i]);
if (audio_ctx[i])
audioStreamCtx_Release_free(&audio_ctx[i]);
}
free(audio_ctx);
filterCtx_Release(&filter_ctx);
if (filter_ctx)
filterCtx_Release(&filter_ctx);
return err;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment