Uses less memory, code is simpler and faster.
Fixes memory leak (noticed by ulion).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24879
b3059339-0415-0410-9bf9-
f77b7e298cf2
assert(codepage);
{
- char* cp_tmp = codepage ? strdup(codepage) : 0;
+ const char* cp_tmp = codepage;
#ifdef HAVE_ENCA
char enca_lang[3], enca_fallback[100];
if (sscanf(codepage, "enca:%2s:%99s", enca_lang, enca_fallback) == 2
mp_msg(MSGT_ASS,MSGL_V,"LIBSUB: opened iconv descriptor.\n");
} else
mp_msg(MSGT_ASS,MSGL_ERR,MSGTR_LIBASS_ErrorOpeningIconvDescriptor);
-#ifdef HAVE_ENCA
- if (cp_tmp) free(cp_tmp);
-#endif
}
{