mirror of
https://github.com/nu774/fdkaac.git
synced 2025-04-13 23:12:03 +02: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;
|
++encoded;
|
||||||
if (encoded == 1 || encoded == 3)
|
if (encoded == 1 || encoded == 3)
|
||||||
continue;
|
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;
|
goto END;
|
||||||
++frames_written;
|
++frames_written;
|
||||||
} while (remaining > 0);
|
} 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:
|
DONE:
|
||||||
if (!params->silent)
|
if (!params->silent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user