comparison raw.c @ 2304:763527841a80 libavformat

additional tweaks to AC3 probe function. give a higher score to a single frame at the start of the stream. also read all available data in the probe buffer.
author jbr
date Sun, 05 Aug 2007 00:32:19 +0000
parents 36009df78f49
children 7843ebbe9b0a
comparison
equal deleted inserted replaced
2303:36009df78f49 2304:763527841a80
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(5120, p->buf_size - 7); 422 end = buf + p->buf_size;
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>=2) return AVPROBE_SCORE_MAX / 2; 437 else if(max_frames>=2 || first_frames>=1) 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 = {