1
0
mirror of https://github.com/nu774/fdkaac.git synced 2025-06-05 23:29:14 +02:00

6 Commits

Author SHA1 Message Date
33e12bc4f5 bump version 2013-01-17 17:12:06 +09:00
bfb6aa3cb8 compat_win32: free argv with atexit() 2013-01-17 17:11:19 +09:00
360cf7dc8b take care of COPYRIGHT-SIGN in UTF-8 2013-01-17 17:10:21 +09:00
43ab433178 bump version 2013-01-15 21:20:18 +09:00
47c164c85a fix return type of put_type_entry() to void 2013-01-15 21:19:32 +09:00
d52b8bbf13 add ADTS header size(7) to output byte length 2013-01-15 21:18:31 +09:00
4 changed files with 24 additions and 3 deletions

View File

@ -142,7 +142,7 @@ int aac_encode_frame(HANDLE_AACENCODER encoder,
unsigned channel_mode, obytes; unsigned channel_mode, obytes;
channel_mode = aacEncoder_GetParam(encoder, AACENC_CHANNELMODE); channel_mode = aacEncoder_GetParam(encoder, AACENC_CHANNELMODE);
obytes = 6144 / 8 * channel_mode; obytes = 6144 / 8 * channel_mode + 7;
if (!*output || *osize < obytes) { if (!*output || *osize < obytes) {
*osize = obytes; *osize = obytes;
*output = realloc(*output, obytes); *output = realloc(*output, obytes);

View File

@ -75,6 +75,17 @@ FILE *aacenc_fopen(const char *name, const char *mode)
return fp; return fp;
} }
static char **__aacenc_argv__;
static
void aacenc_free_mainargs(void)
{
char **p = __aacenc_argv__;
for (; *p; ++p)
free(*p);
free(__aacenc_argv__);
}
void aacenc_getmainargs(int *argc, char ***argv) void aacenc_getmainargs(int *argc, char ***argv)
{ {
int i; int i;
@ -86,6 +97,8 @@ void aacenc_getmainargs(int *argc, char ***argv)
for (i = 0; i < *argc; ++i) for (i = 0; i < *argc; ++i)
codepage_encode_wchar(CP_UTF8, wargv[i], &(*argv)[i]); codepage_encode_wchar(CP_UTF8, wargv[i], &(*argv)[i]);
(*argv)[*argc] = 0; (*argv)[*argc] = 0;
__aacenc_argv__ = *argv;
atexit(aacenc_free_mainargs);
} }
char *aacenc_to_utf8(const char *s) char *aacenc_to_utf8(const char *s)

View File

@ -357,6 +357,14 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
} }
*val++ = '\0'; *val++ = '\0';
if (ch == OPT_SHORT_TAG) { if (ch == OPT_SHORT_TAG) {
/*
* take care of U+00A9(COPYRIGHT SIGN).
* 1) if length of fcc is 3, we prepend '\xa9'.
* 2) U+00A9 becomes "\xc2\xa9" in UTF-8. Therefore
* we remove first '\xc2'.
*/
if (optarg[0] == '\xc2')
++optarg;
if ((klen = strlen(optarg))== 3) if ((klen = strlen(optarg))== 3)
fcc = 0xa9; fcc = 0xa9;
else if (klen != 4) { else if (klen != 4) {
@ -470,7 +478,7 @@ END:
} }
static static
int put_tag_entry(m4af_writer_t *m4af, const aacenc_tag_entry_t *tag) void put_tag_entry(m4af_writer_t *m4af, const aacenc_tag_entry_t *tag)
{ {
unsigned m, n = 0; unsigned m, n = 0;

View File

@ -1,4 +1,4 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
const char *fdkaac_version = "0.1.0"; const char *fdkaac_version = "0.1.2";
#endif #endif