comparison raw.c @ 2303:36009df78f49 libavformat

increase the maximum AC3 probe buffer size and reduce the threshold for 50% reliability score to 2 frames. Fixes out.ac3 from [FFmpeg-devel] AC3 Format Detection unreliable.
author jbr
date Sat, 04 Aug 2007 23:53:05 +0000
parents b21c2af60bc9
children 763527841a80
comparison
equal deleted inserted replaced
2302:33033ec6fc6c 2303:36009df78f49
417 if(p->buf_size < 7) 417 if(p->buf_size < 7)
418 return 0; 418 return 0;
419 419
420 max_frames = 0; 420 max_frames = 0;
421 buf = p->buf; 421 buf = p->buf;
422 end = buf + FFMIN(4096, p->buf_size - 7); 422 end = buf + FFMIN(5120, p->buf_size - 7);
423 423
424 for(; buf < end; buf++) { 424 for(; buf < end; buf++) {
425 buf2 = buf; 425 buf2 = buf;
426 426
427 for(frames = 0; buf2 < end; frames++) { 427 for(frames = 0; buf2 < end; frames++) {
432 max_frames = FFMAX(max_frames, frames); 432 max_frames = FFMAX(max_frames, frames);
433 if(buf == p->buf) 433 if(buf == p->buf)
434 first_frames = frames; 434 first_frames = frames;
435 } 435 }
436 if (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4; 436 if (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;
437 else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2; 437 else if(max_frames>=2) return AVPROBE_SCORE_MAX / 2;
438 else if(max_frames>=1) return 1; 438 else if(max_frames>=1) return 1;
439 else return 0; 439 else return 0;
440 } 440 }
441 441
442 AVInputFormat shorten_demuxer = { 442 AVInputFormat shorten_demuxer = {