MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / get_preset_file_2

Function get_preset_file_2

ffmpeg-single-cmd/src/main/cpp/ffmpeg_opt.c:1160–1184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1158}
1159
1160static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
1161{
1162 int i, ret = -1;
1163 char filename[1000];
1164 const char *base[3] = { getenv("AVCONV_DATADIR"),
1165 getenv("HOME"),
1166 AVCONV_DATADIR,
1167 };
1168
1169 for (i = 0; i < FF_ARRAY_ELEMS(base) && ret < 0; i++) {
1170 if (!base[i])
1171 continue;
1172 if (codec_name) {
1173 snprintf(filename, sizeof(filename), "%s%s/%s-%s.avpreset", base[i],
1174 i != 1 ? "" : "/.avconv", codec_name, preset_name);
1175 ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);
1176 }
1177 if (ret < 0) {
1178 snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i],
1179 i != 1 ? "" : "/.avconv", preset_name);
1180 ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);
1181 }
1182 }
1183 return ret;
1184}
1185
1186static int choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
1187{

Callers 1

new_output_streamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected