Mercurial > libavformat.hg
comparison raw.c @ 3238:db733a434b2c libavformat
change ff_ac3_parse_header() to take a GetBitContext instead of const char*
author | bwolowiec |
---|---|
date | Tue, 22 Apr 2008 11:14:01 +0000 |
parents | 4fa7ec10b57e |
children | 319c36da904b |
comparison
equal
deleted
inserted
replaced
3237:4fa7ec10b57e | 3238:db733a434b2c |
---|---|
21 */ | 21 */ |
22 #include "avformat.h" | 22 #include "avformat.h" |
23 #include "ac3_parser.h" | 23 #include "ac3_parser.h" |
24 #include "raw.h" | 24 #include "raw.h" |
25 #include "crc.h" | 25 #include "crc.h" |
26 #include "bitstream.h" | |
26 | 27 |
27 #ifdef CONFIG_MUXERS | 28 #ifdef CONFIG_MUXERS |
28 /* simple formats */ | 29 /* simple formats */ |
29 static int flac_write_header(struct AVFormatContext *s) | 30 static int flac_write_header(struct AVFormatContext *s) |
30 { | 31 { |
417 static int ac3_probe(AVProbeData *p) | 418 static int ac3_probe(AVProbeData *p) |
418 { | 419 { |
419 int max_frames, first_frames = 0, frames; | 420 int max_frames, first_frames = 0, frames; |
420 uint8_t *buf, *buf2, *end; | 421 uint8_t *buf, *buf2, *end; |
421 AC3HeaderInfo hdr; | 422 AC3HeaderInfo hdr; |
423 GetBitContext gbc; | |
422 | 424 |
423 max_frames = 0; | 425 max_frames = 0; |
424 buf = p->buf; | 426 buf = p->buf; |
425 end = buf + p->buf_size; | 427 end = buf + p->buf_size; |
426 | 428 |
427 for(; buf < end; buf++) { | 429 for(; buf < end; buf++) { |
428 buf2 = buf; | 430 buf2 = buf; |
429 | 431 |
430 for(frames = 0; buf2 < end; frames++) { | 432 for(frames = 0; buf2 < end; frames++) { |
431 if(ff_ac3_parse_header(buf2, &hdr) < 0) | 433 init_get_bits(&gbc, buf2, 54); |
434 if(ff_ac3_parse_header(&gbc, &hdr) < 0) | |
432 break; | 435 break; |
433 if(buf2 + hdr.frame_size > end || | 436 if(buf2 + hdr.frame_size > end || |
434 av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2)) | 437 av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2)) |
435 break; | 438 break; |
436 buf2 += hdr.frame_size; | 439 buf2 += hdr.frame_size; |