Mercurial > mplayer.hg
annotate gui/app/cfg-old.c @ 37072:9ed2c7f5c941
Rewrite add_vf().
Prefer calloc() to malloc().
As a result, vf_settings[1] doesn't need to be cleared.
Additionally, check the result of the allocation.
author | ib |
---|---|
date | Thu, 24 Apr 2014 12:50:14 +0000 |
parents | 277882d42938 |
children |
rev | line source |
---|---|
35871 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
19 /** | |
20 * @file | |
21 * @brief Translation of old settings or old configure options | |
22 */ | |
23 | |
24 /** | |
35920 | 25 * @brief Convert a filename into the original byte sequence |
26 * according to the encoding specified in G_FILENAME_ENCODING, | |
27 * if it's currently in UTF-8. | |
35871 | 28 * |
29 * @param fname filename | |
30 * | |
31 * @return converted filename | |
32 */ | |
33 static const gchar *cfg_old_filename_from_utf8(const gchar *fname) | |
34 { | |
35926 | 35 #if defined(CFG_OLD_PLAYLIST) || defined(CFG_OLD_FILESELECT) |
35871 | 36 static gchar *name; |
37 | |
38 if (g_utf8_validate(fname, -1, NULL)) { | |
39 free(name); | |
40 name = g_filename_from_utf8(fname, -1, NULL, NULL, NULL); | |
41 | |
42 return name; | |
43 } | |
35872
93ab56bda68a
Utilize new cfg_old_filename_from_utf8() in playlist code.
ib
parents:
35871
diff
changeset
|
44 #endif |
35871 | 45 return fname; |
46 } |