68 last_iformat = &format->
next;
78 last_oformat = &format->
next;
89 ext = strrchr(filename,
'.');
95 while (*p !=
'\0' && *p !=
',' && q - ext1 <
sizeof(ext1) - 1)
109 const char *mime_type)
112 int score_max, score;
115 #if CONFIG_IMAGE2_MUXER
116 if (!short_name && filename &&
135 if (score > score_max) {
144 const char *filename,
const char *mime_type,
156 #if CONFIG_IMAGE2_MUXER
157 if (!strcmp(fmt->
name,
"image2") || !strcmp(fmt->
name,
"image2pipe")) {
186 int score, nodat = 0, score_max = 0;
190 lpd.
buf = zerobuffer;
211 if (nodat == 0) score =
FFMAX(score, 1);
221 if (score > score_max) {
224 }
else if (score == score_max)
229 *score_ret = score_max;
238 if (score_ret > *score_max) {
239 *score_max = score_ret;
252 const char *filename,
void *logctx,
253 unsigned int offset,
unsigned int max_probe_size)
257 int ret = 0, probe_size, buf_offset = 0;
265 "Specified probe size value %u cannot be < %u\n", max_probe_size,
PROBE_BUF_MIN);
269 if (offset >= max_probe_size)
284 probe_size =
FFMIN(probe_size << 1,
285 FFMAX(max_probe_size, probe_size + 1))) {
291 if ((ret =
avio_read(pb, buf + buf_offset,
292 probe_size - buf_offset)) < 0) {
301 if (buf_offset < offset)
314 "Format %s detected only with low score of %d, "
315 "misdetection possible!\n", (*fmt)->name, score);
318 "Format %s probed with size=%d and score=%d\n",
319 (*fmt)->name, probe_size, score);
321 FILE *f = fopen(
"probestat.tmp",
"ab");
322 fprintf(f,
"probe_size:%d format:%s score:%d filename:%s\n", probe_size, (*fmt)->name, score, filename);
338 return ret < 0 ? ret : score;
342 const char *filename,
void *logctx,
343 unsigned int offset,
unsigned int max_probe_size)
346 return ret < 0 ? ret : 0;