Mercurial > libavformat.hg
comparison raw.c @ 1768:7598146fe1cc libavformat
add read_probe function to raw ac3 demuxer
author | jbr |
---|---|
date | Thu, 08 Feb 2007 23:41:08 +0000 |
parents | 5d72afc6c8aa |
children | 4b8313d5b23b |
comparison
equal
deleted
inserted
replaced
1767:f1186797fbf5 | 1768:7598146fe1cc |
---|---|
404 return 50; | 404 return 50; |
405 } | 405 } |
406 return 0; | 406 return 0; |
407 } | 407 } |
408 | 408 |
409 static int ac3_probe(AVProbeData *p) | |
410 { | |
411 int score=0; | |
412 | |
413 if(p->buf_size < 6) | |
414 return 0; | |
415 | |
416 if((p->buf[0] == 0x0B) && (p->buf[1] == 0x77) && // sync word | |
417 ((p->buf[4] >> 6) != 3) && // fscod | |
418 ((p->buf[5] >> 3) <= 16)) { // bsid | |
419 score = AVPROBE_SCORE_MAX / 2 + 10; | |
420 } | |
421 | |
422 return score; | |
423 } | |
424 | |
409 AVInputFormat shorten_demuxer = { | 425 AVInputFormat shorten_demuxer = { |
410 "shn", | 426 "shn", |
411 "raw shorten", | 427 "raw shorten", |
412 0, | 428 0, |
413 NULL, | 429 NULL, |
448 | 464 |
449 AVInputFormat ac3_demuxer = { | 465 AVInputFormat ac3_demuxer = { |
450 "ac3", | 466 "ac3", |
451 "raw ac3", | 467 "raw ac3", |
452 0, | 468 0, |
453 NULL, | 469 ac3_probe, |
454 ac3_read_header, | 470 ac3_read_header, |
455 raw_read_partial_packet, | 471 raw_read_partial_packet, |
456 raw_read_close, | 472 raw_read_close, |
457 .flags= AVFMT_GENERIC_INDEX, | 473 .flags= AVFMT_GENERIC_INDEX, |
458 .extensions = "ac3", | 474 .extensions = "ac3", |