1 /*
2 * Various utilities for command line tools
3 * Copyright (c) 2000-2003 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #include <string.h>
23 #include <stdint.h>
24 #include <stdlib.h>
25 #include <errno.h>
26 #include <math.h>
27
28 /* Include only the enabled headers since some compilers (namely, Sun
29 Studio) will not omit unused inline functions and create undefined
30 references to libraries that are not being built. */
31
32 #include "config.h"
51 #ifdef _WIN32
52 #include <windows.h>
54 #endif
55
59
61
63 {
68 }
69
71 {
72 vfprintf(stdout, fmt, vl);
73 }
74
76 {
77 #if HAVE_SETDLLDIRECTORY && defined(_WIN32)
78 /* Calling SetDllDirectory with the empty string (but not NULL) removes the
79 * current working directory from the DLL search path as a security pre-caution. */
80 SetDllDirectory("");
81 #endif
82 }
83
86 {
87 char *tail;
90 if (*tail)
91 error =
"Expected number for %s but found: %s\n";
92 else if (d < min || d >
max)
93 error =
"The value for %s was %s which is not within %f - %f\n";
95 error =
"Expected int64 for %s but found %s\n";
97 error =
"Expected int for %s but found %s\n";
98 else {
100 return 0;
101 }
102
105 }
106
108 int rej_flags)
109 {
112
115 char buf[128];
116
117 if (((po->
flags & req_flags) != req_flags) ||
118 (po->
flags & rej_flags))
119 continue;
120
124 }
126
128 av_strlcat(buf,
"[:<stream_spec>]",
sizeof(buf));
131
134
136 }
138 }
139
141 {
147 }
148
151 }
152
154 {
157
159 const char *end;
161 break;
162 po++;
163 }
164 return po;
165 }
166
167 /* _WIN32 means using the windows libc - cygwin doesn't define that
168 * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while
169 * it doesn't provide the actual command line via GetCommandLineW(). */
170 #if HAVE_COMMANDLINETOARGVW && defined(_WIN32)
171 #include <shellapi.h>
172 /* Will be leaked on exit */
173 static char** win32_argv_utf8 =
NULL;
174 static int win32_argc = 0;
175
176 /**
177 * Prepare command line arguments for executable.
178 * For Windows - perform wide-char to UTF-8 conversion.
179 * Input arguments should be main() function arguments.
180 * @param argc_ptr Arguments number (including executable)
181 * @param argv_ptr Arguments list.
182 */
184 {
185 char *argstr_flat;
186 wchar_t **argv_w;
187 int i, buffsize = 0,
offset = 0;
188
189 if (win32_argv_utf8) {
190 *argc_ptr = win32_argc;
191 *argv_ptr = win32_argv_utf8;
192 return;
193 }
194
195 win32_argc = 0;
196 argv_w = CommandLineToArgvW(GetCommandLineW(), &win32_argc);
197 if (win32_argc <= 0 || !argv_w)
198 return;
199
200 /* determine the UTF-8 buffer size (including NULL-termination symbols) */
201 for (
i = 0;
i < win32_argc;
i++)
202 buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[
i], -1,
204
205 win32_argv_utf8 =
av_mallocz(
sizeof(
char *) * (win32_argc + 1) + buffsize);
206 argstr_flat = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1);
207 if (!win32_argv_utf8) {
208 LocalFree(argv_w);
209 return;
210 }
211
212 for (
i = 0;
i < win32_argc;
i++) {
213 win32_argv_utf8[
i] = &argstr_flat[
offset];
214 offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[
i], -1,
217 }
218 win32_argv_utf8[
i] =
NULL;
219 LocalFree(argv_w);
220
221 *argc_ptr = win32_argc;
222 *argv_ptr = win32_argv_utf8;
223 }
224 #else
226 {
227 /* nothing to do */
228 }
229 #endif /* HAVE_COMMANDLINETOARGVW */
230
232 {
234 return 0;
237 return 1;
238 }
239
242 {
243 /* new-style options contain an offset into optctx, old-style address of
244 * a global var*/
247 char *arg_allocated =
NULL;
248
250
252 double num;
254
256 opt++;
257
260 "Requested to load an argument from file for an option '%s'"
261 " which does not take an argument\n",
264 }
265
267 if (!arg_allocated) {
269 "Error reading the value for option '%s' from file: %s\n",
272 }
273
275 }
276
278 char *
p = strchr(opt,
':');
279 char *str;
280
285
287 if (!str) {
290 }
291 sol->opt[sol->nb_opt - 1].specifier = str;
292
298 }
299
300 dst = &sol->opt[sol->nb_opt - 1].u;
301 }
302
304 char *str;
305 if (arg_allocated) {
306 str = arg_allocated;
307 arg_allocated =
NULL;
308 } else
311
312 if (!str) {
315 }
316
322
329
337 }
343
349
350 *(
double *)
dst = num;
351 } else {
353
356 if ((strcmp(opt,
"init_hw_device") != 0) || (strcmp(
arg,
"list") != 0)) {
358 "Failed to set value '%s' for option '%s': %s\n",
360 }
362 }
363 }
367 }
368
369 if (sol) {
370 sol->type = so_type;
373 }
374
378 }
379
382 {
384 .
name =
"AVOption passthrough",
388 };
389
392
394 if (!po->
name && opt[0] ==
'n' && opt[1] ==
'o') {
395 /* handle 'no' bool option */
401
403 po = &opt_avoptions;
407 }
411 }
412
416
418 }
419
421 int (*parse_arg_function)(void *, const char*))
422 {
423 const char *opt;
424 int optindex, handleoptions = 1,
ret;
425
426 /* perform system-dependent conversions for arguments list */
428
429 /* parse options */
430 optindex = 1;
431 while (optindex < argc) {
432 opt = argv[optindex++];
433
434 if (handleoptions && opt[0] == '-' && opt[1] != '0円') {
435 if (opt[1] == '-' && opt[2] == '0円') {
436 handleoptions = 0;
437 continue;
438 }
439 opt++;
440
444 } else {
445 if (parse_arg_function) {
446 ret = parse_arg_function(optctx, opt);
449 }
450 }
451 }
452
453 return 0;
454 }
455
457 {
459
461 g->group_def->name,
g->arg);
462
463 for (
i = 0;
i <
g->nb_opts;
i++) {
465
466 if (
g->group_def->flags &&
467 !(
g->group_def->flags & o->
opt->
flags)) {
469 "%s %s -- you are trying to apply an input option to an "
470 "output file or vice versa. Move this option before the "
471 "file it belongs to.\n", o->
key, o->
opt->
help,
472 g->group_def->name,
g->arg);
474 }
475
478
482 }
483
485
486 return 0;
487 }
488
490 const char *optname)
491 {
494
495 for (
i = 1;
i < argc;
i++) {
496 const char *cur_opt = argv[
i];
497
498 if (!(cur_opt[0] == '-' && cur_opt[1]))
499 continue;
500 cur_opt++;
501
503 if (!po->
name && cur_opt[0] ==
'n' && cur_opt[1] ==
'o')
505
506 if ((!po->
name && !strcmp(cur_opt, optname)) ||
507 (po->
name && !strcmp(optname, po->
name)))
509
512 }
513 return 0;
514 }
515
517 {
518 const unsigned char *
p;
519
521 if (!((*
p >=
'+' && *
p <=
':') || (*
p >=
'@' && *
p <=
'Z') ||
522 *
p ==
'_' || (*
p >=
'a' && *
p <=
'z')))
523 break;
526 return;
527 }
529 for (
p =
a; *
p;
p++) {
530 if (*
p ==
'\\' || *
p ==
'"' || *
p ==
'$' || *
p ==
'`')
532 else if (*p < ' ' || *p > '~')
534 else
536 }
538 }
539
541 {
545
548
549 // OPT_FUNC_ARG can only be ser for OPT_TYPE_FUNC
551
552 po++;
553 }
554 }
555
557 {
558 int idx;
559 char *env;
560
562
564 if (!idx)
566 if (idx && argv[idx + 1])
570 if (env || idx) {
576 for (
i = 0;
i < argc;
i++) {
579 }
581 }
582 }
585 if (idx)
587 }
588
590 int opt_flags, int search_flags)
591 {
595 return o;
596 }
597
598 #define FLAGS ((o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0)
600 {
602 int consumed = 0;
603 char opt_stripped[128];
606 #if CONFIG_SWSCALE
608 #endif
609 #if CONFIG_SWRESAMPLE
611 #endif
612
613 if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
615
616 if (!(
p = strchr(opt,
':')))
617 p = opt + strlen(opt);
619
622 ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
625 consumed = 1;
626 }
630 if (consumed)
632 consumed = 1;
633 }
634 #if CONFIG_SWSCALE
637 if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
638 !strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
639 !strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
640 av_log(
NULL,
AV_LOG_ERROR,
"Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
642 }
644
645 consumed = 1;
646 }
647 #else
648 if (!consumed && !strcmp(opt, "sws_flags")) {
650 consumed = 1;
651 }
652 #endif
653 #if CONFIG_SWRESAMPLE
657 consumed = 1;
658 }
659 #endif
660
661 if (consumed)
662 return 0;
664 }
665
666 /*
667 * Check whether given option is a group separator.
668 *
669 * @return index of the group definition that matched or -1 if none
670 */
672 const char *opt)
673 {
675
676 for (
i = 0;
i < nb_groups;
i++) {
678 if (
p->sep && !strcmp(
p->sep, opt))
680 }
681
682 return -1;
683 }
684
685 /*
686 * Finish parsing an option group.
687 *
688 * @param group_idx which group definition should this group belong to
689 * @param arg argument of the group delimiting option
690 */
693 {
697
701
703
711
716
718
720 }
721
722 /*
723 * Add an option instance to currently parsed group.
724 */
726 const char *
key,
const char *
val)
727 {
731
735
736 g->opts[
g->nb_opts - 1].opt = opt;
737 g->opts[
g->nb_opts - 1].key =
key;
738 g->opts[
g->nb_opts - 1].val =
val;
739
740 return 0;
741 }
742
745 {
748
749 memset(octx, 0, sizeof(*octx));
750
755
758
761
762 return 0;
763 }
764
766 {
768
771
776
779 }
781 }
783
786
788 }
789
793 {
795 int optindex = 1;
796 int dashdash = -2;
797
798 /* perform system-dependent conversions for arguments list */
800
804
806
807 while (optindex < argc) {
808 const char *opt = argv[optindex++], *
arg;
810 int group_idx;
811
813
814 if (opt[0] == '-' && opt[1] == '-' && !opt[2]) {
815 dashdash = optindex;
816 continue;
817 }
818 /* unnamed group separators, e.g. output filename */
819 if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) {
823
825 continue;
826 }
827 opt++;
828
829 #define GET_ARG(arg) \
830 do { \
831 arg = argv[optindex++]; \
832 if (!arg) { \
833 av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'.\n", opt);\
834 return AVERROR(EINVAL); \
835 } \
836 } while (0)
837
838 /* named group separators, e.g. -i */
840 if (group_idx >= 0) {
845
848 continue;
849 }
850
851 /* normal options */
855 /* optional argument, e.g. -h */
856 arg = argv[optindex++];
859 } else {
861 }
862
866
869 continue;
870 }
871
872 /* AVOptions */
873 if (argv[optindex]) {
877 "argument '%s'.\n", opt, argv[optindex]);
878 optindex++;
879 continue;
882 "with argument '%s'.\n", opt, argv[optindex]);
884 }
885 }
886
887 /* boolean -nofoo options */
888 if (opt[0] == 'n' && opt[1] == 'o' &&
894
896 "argument 0.\n", po->
name, po->
help);
897 continue;
898 }
899
902 }
903
906 "command: may be ignored.\n");
907
909
910 return 0;
911 }
912
914 {
917
918 while (
c !=
'\n' &&
c != EOF)
920
921 return yesno;
922 }
923
925 const char *preset_name, int is_path,
926 const char *codec_name)
927 {
930 #if HAVE_GETMODULEHANDLE && defined(_WIN32)
931 char *datadir =
NULL;
932 #endif
934 char *env_ffmpeg_datadir =
getenv_utf8(
"FFMPEG_DATADIR");
935 const char *
base[3] = { env_ffmpeg_datadir,
936 env_home, /* index=1(HOME) is special: search in a .ffmpeg subfolder */
937 FFMPEG_DATADIR, };
938
939 if (is_path) {
940 av_strlcpy(filename, preset_name, filename_size);
942 } else {
943 #if HAVE_GETMODULEHANDLE && defined(_WIN32)
944 wchar_t *datadir_w = get_module_filename(
NULL);
946
947 if (wchartoutf8(datadir_w, &datadir))
950
951 if (datadir)
952 {
953 char *ls;
954 for (ls = datadir; *ls; ls++)
955 if (*ls == '\\') *ls = '/';
956
957 if (ls = strrchr(datadir, '/'))
958 {
959 ptrdiff_t datadir_len = ls - datadir;
960 size_t desired_size = datadir_len + strlen("/ffpresets") + 1;
962 datadir, desired_size, sizeof *datadir);
963 if (new_datadir) {
964 datadir = new_datadir;
965 datadir[datadir_len] = 0;
966 strncat(datadir, "/ffpresets", desired_size - 1 - datadir_len);
968 }
969 }
970 }
971 #endif
972 for (
i = 0;
i < 3 && !
f;
i++) {
974 continue;
975 snprintf(filename, filename_size,
"%s%s/%s.ffpreset",
base[
i],
976 i != 1 ?
"" :
"/.ffmpeg", preset_name);
978 if (!
f && codec_name) {
980 "%s%s/%s-%s.ffpreset",
981 base[
i],
i != 1 ?
"" :
"/.ffmpeg", codec_name,
982 preset_name);
984 }
985 }
986 }
987
988 #if HAVE_GETMODULEHANDLE && defined(_WIN32)
990 #endif
994 }
995
997 {
998 return (
c >=
'0' &&
c <=
'9') ||
999 (
c >=
'A' &&
c <=
'Z') ||
1000 (
c >=
'a' &&
c <=
'z');
1001 }
1002
1004 {
1008
1009 memset(
ss, 0,
sizeof(*
ss));
1010 }
1011
1013 int allow_remainder, void *logctx)
1014 {
1015 char *endptr;
1017
1018 memset(
ss, 0,
sizeof(*
ss));
1019
1023
1025
1026 while (*spec) {
1027 if (*spec <= '9' && *spec >= '0') { /* opt:index */
1028 ss->idx = strtol(spec, &endptr, 0);
1029
1031 spec = endptr;
1032
1034 "Parsed index: %d; remainder: %s\n",
ss->idx, spec);
1035
1036 // this terminates the specifier
1037 break;
1038 } else if ((*spec == 'v' || *spec == 'a' || *spec == 's' ||
1039 *spec == 'd' || *spec == 't' || *spec == 'V') &&
1045 }
1046
1047 switch (*spec++) {
1054 ss->no_apic = 1;
break;
1056 }
1057
1060 } else if (*spec == 'g' && *(spec + 1) == ':') {
1062 goto multiple_stream_lists;
1063
1064 spec += 2;
1065 if (*spec == '#' || (*spec == 'i' && *(spec + 1) == ':')) {
1067
1068 spec += 1 + (*spec == 'i');
1069 } else
1071
1072 ss->list_id = strtol(spec, &endptr, 0);
1073 if (spec == endptr) {
1077 }
1078 spec = endptr;
1079
1082 } else if (*spec == 'p' && *(spec + 1) == ':') {
1084 goto multiple_stream_lists;
1085
1087
1088 spec += 2;
1089 ss->list_id = strtol(spec, &endptr, 0);
1090 if (spec == endptr) {
1094 }
1095 spec = endptr;
1096
1098 "Parsed program ID: %"PRId64
"; remainder: %s\n",
ss->list_id, spec);
1099 } else if (!strncmp(spec, "disp:", 5)) {
1104
1106
1107 if (
ss->disposition) {
1111 }
1112
1113 spec += 5;
1114
1116 spec[
len] ==
'_' || spec[
len] ==
'+';
len++)
1117 continue;
1118
1120 if (!disp) {
1123 }
1124
1130 }
1131
1133
1135 "Parsed disposition: 0x%x; remainder: %s\n",
ss->disposition, spec);
1136 } else if (*spec == '#' ||
1137 (*spec == 'i' && *(spec + 1) == ':')) {
1139 goto multiple_stream_lists;
1140
1142
1143 spec += 1 + (*spec == 'i');
1144 ss->list_id = strtol(spec, &endptr, 0);
1145 if (spec == endptr) {
1149 }
1150 spec = endptr;
1151
1153 "Parsed stream ID: %"PRId64
"; remainder: %s\n",
ss->list_id, spec);
1154
1155 // this terminates the specifier
1156 break;
1157 } else if (*spec == 'm' && *(spec + 1) == ':') {
1159
1160 spec += 2;
1162 if (!
ss->meta_key) {
1165 }
1166 if (*spec == ':') {
1167 spec++;
1169 if (!
ss->meta_val) {
1172 }
1173 }
1174
1176 "Parsed metadata: %s:%s; remainder: %s",
ss->meta_key,
1177 ss->meta_val ?
ss->meta_val :
"<any value>", spec);
1178
1179 // this terminates the specifier
1180 break;
1181 } else if (*spec == 'u' && (*(spec + 1) == '0円' || *(spec + 1) == ':')) {
1182 ss->usable_only = 1;
1183 spec++;
1185
1186 // this terminates the specifier
1187 break;
1188 } else
1189 break;
1190
1191 if (*spec == ':')
1192 spec++;
1193 }
1194
1195 if (*spec) {
1196 if (!allow_remainder) {
1198 "Trailing garbage at the end of a stream specifier: %s\n",
1199 spec);
1202 }
1203
1204 if (*spec == ':')
1205 spec++;
1206
1208 if (!
ss->remainder) {
1211 }
1212 }
1213
1214 return 0;
1215
1216 multiple_stream_lists:
1218 "Cannot combine multiple program/group designators in a "
1219 "single stream specifier");
1221
1225 }
1226
1229 void *logctx)
1230 {
1234 int nb_matched = 0;
1235
1236 switch (
ss->stream_list) {
1238 // <n-th> stream with given ID makes no sense and should be impossible to request
1240 // return early if we know for sure the stream does not match
1241 if (st->
id !=
ss->list_id)
1242 return 0;
1243 start_stream = st->
index;
1245 break;
1247 start_stream =
ss->idx >= 0 ? 0 : st->
index;
1249 break;
1251 for (
unsigned i = 0;
i <
s->nb_programs;
i++) {
1252 if (
s->programs[
i]->id ==
ss->list_id) {
1254 break;
1255 }
1256 }
1259 " stream specifier can never match\n",
ss->list_id);
1260 return 0;
1261 }
1263 break;
1265 for (
unsigned i = 0;
i <
s->nb_stream_groups;
i++) {
1266 if (
ss->list_id ==
s->stream_groups[
i]->id) {
1267 g =
s->stream_groups[
i];
1268 break;
1269 }
1270 }
1271 // fall-through
1274 ss->list_id >= 0 &&
ss->list_id <
s->nb_stream_groups)
1275 g =
s->stream_groups[
ss->list_id];
1276
1279 PRId64" exists, stream specifier can never match\n",
1282 return 0;
1283 }
1285 break;
1287 }
1288
1290 const AVStream *candidate =
s->streams[
g ?
g->streams[
i]->index :
1291 p ?
p->stream_index[
i] :
i];
1292
1296 continue;
1297
1301
1303 continue;
1304 if (
ss->meta_val && strcmp(
tag->value,
ss->meta_val))
1305 continue;
1306 }
1307
1308 if (
ss->usable_only) {
1310
1315 continue;
1316 break;
1319 continue;
1320 break;
1322 continue;
1323 }
1324 }
1325
1326 if (
ss->disposition &&
1328 continue;
1329
1330 if (st == candidate)
1331 return ss->idx < 0 ||
ss->idx == nb_matched;
1332
1333 nb_matched++;
1334 }
1335
1336 return 0;
1337 }
1338
1340 {
1343
1347
1351 }
1352
1355 void *logctx)
1356 {
1357 int start_stream_group = 0, nb_stream_groups;
1358 int nb_matched = 0;
1359
1361 return 0;
1362
1363 switch (
ss->stream_list) {
1367 return 0;
1369 // <n-th> stream with given ID makes no sense and should be impossible to request
1371 // return early if we know for sure the stream does not match
1372 if (stg->
id !=
ss->list_id)
1373 return 0;
1374 start_stream_group = stg->
index;
1375 nb_stream_groups = stg->
index + 1;
1376 break;
1378 start_stream_group =
ss->list_id >= 0 ? 0 : stg->
index;
1379 nb_stream_groups = stg->
index + 1;
1380 break;
1382 }
1383
1384 for (
int i = start_stream_group;
i < nb_stream_groups;
i++) {
1386
1390
1392 continue;
1393 if (
ss->meta_val && strcmp(
tag->value,
ss->meta_val))
1394 continue;
1395 }
1396
1397 if (
ss->usable_only) {
1398 switch (candidate->
type) {
1403 continue;
1404 break;
1405 }
1406 default:
1407 continue;
1408 }
1409 }
1410
1411 if (
ss->disposition &&
1413 continue;
1414
1415 if (stg == candidate)
1416 return ss->list_id < 0 ||
ss->list_id == nb_matched;
1417
1418 nb_matched++;
1419 }
1420
1421 return 0;
1422 }
1423
1427 {
1432 char prefix = 0;
1434
1437 prefix = 'v';
1439 break;
1441 prefix = 'a';
1443 break;
1445 prefix = 's';
1447 break;
1448 }
1449
1452 char *
p = strchr(t->
key,
':');
1453 int used = 0;
1454
1455 /* check stream specification in opt name */
1458 if (err < 0) {
1460 return err;
1461 } else if (!err)
1462 continue;
1463
1465 }
1466
1468 !codec ||
1473 used = 1;
1474 }
else if (t->
key[0] == prefix &&
1478 used = 1;
1479 }
1480
1483
1484 if (used && opts_used)
1486 }
1487
1489 return 0;
1490 }
1491
1495 {
1498
1500
1502 return 0;
1503
1507
1508 for (
int i = 0;
i <
s->nb_streams;
i++) {
1513 }
1515 return 0;
1517 for (
int i = 0;
i <
s->nb_streams;
i++)
1521 }
1522
1524 {
1525 if (new_size >= INT_MAX / elem_size) {
1528 }
1529 if (*
size < new_size) {
1533 memset(
tmp + *
size*elem_size, 0, (new_size-*
size) * elem_size);
1536 return 0;
1537 }
1538 return 0;
1539 }
1540
1542 {
1543 void *new_elem;
1544
1546 if (!new_elem)
1550
1551 return new_elem;
1552 }
1553
1555 {
1556 double theta = 0;
1557 if (displaymatrix)
1559
1560 theta -= 360*
floor(theta/360 + 0.9/360);
1561
1562 if (
fabs(theta - 90*
round(theta/90)) > 2)
1564 "If you want to help, upload a sample "
1565 "of this file to https://streams.videolan.org/upload/ "
1566 "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
1567
1568 return theta;
1569 }
1570
1571 /* read file contents into a string */
1573 {
1576 AVBPrint bprint;
1577 char *str;
1578
1582 }
1583
1590 }
1594 return str;
1595 }
1596
1598 {
1600
1603 }
1604 }
1605
1607 {
1609 if (t) {
1612 }
1613
1614 return 0;
1615 }