mirror of
https://github.com/nu774/fdkaac.git
synced 2025-03-15 08:20:08 +01:00
fix incorrect iTunSMPB written when interrupted by signals
This commit is contained in:
parent
a1b4f691f5
commit
4140443408
13
src/main.c
13
src/main.c
@ -563,11 +563,20 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
||||
++encoded;
|
||||
if (encoded == 1 || encoded == 3)
|
||||
continue;
|
||||
obp = &obuf[flip];
|
||||
if (write_sample(params->output_fp, m4af, obp) < 0)
|
||||
|
||||
if (write_sample(params->output_fp, m4af, &obuf[flip]) < 0)
|
||||
goto END;
|
||||
++frames_written;
|
||||
} while (remaining > 0);
|
||||
/*
|
||||
* When interrupted, we haven't pulled out last extrapolated frames
|
||||
* from the reader. Therefore, we have to write the final outcome.
|
||||
*/
|
||||
if (g_interrupted) {
|
||||
if (write_sample(params->output_fp, m4af, &obp[flip^1]) < 0)
|
||||
goto END;
|
||||
++frames_written;
|
||||
}
|
||||
}
|
||||
DONE:
|
||||
if (!params->silent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user