Mercurial > libavcodec.hg
comparison parser.c @ 2967:ef2149182f1c libavcodec
COSMETICS: Remove all trailing whitespace.
| author | diego |
|---|---|
| date | Sat, 17 Dec 2005 18:14:38 +0000 |
| parents | 95bac7109ff0 |
| children | bfabfdf9ce55 |
comparison
equal
deleted
inserted
replaced
| 2966:564788471dd4 | 2967:ef2149182f1c |
|---|---|
| 32 AVCodecParserContext *av_parser_init(int codec_id) | 32 AVCodecParserContext *av_parser_init(int codec_id) |
| 33 { | 33 { |
| 34 AVCodecParserContext *s; | 34 AVCodecParserContext *s; |
| 35 AVCodecParser *parser; | 35 AVCodecParser *parser; |
| 36 int ret; | 36 int ret; |
| 37 | 37 |
| 38 if(codec_id == CODEC_ID_NONE) | 38 if(codec_id == CODEC_ID_NONE) |
| 39 return NULL; | 39 return NULL; |
| 40 | 40 |
| 41 for(parser = av_first_parser; parser != NULL; parser = parser->next) { | 41 for(parser = av_first_parser; parser != NULL; parser = parser->next) { |
| 42 if (parser->codec_ids[0] == codec_id || | 42 if (parser->codec_ids[0] == codec_id || |
| 69 return s; | 69 return s; |
| 70 } | 70 } |
| 71 | 71 |
| 72 /* NOTE: buf_size == 0 is used to signal EOF so that the last frame | 72 /* NOTE: buf_size == 0 is used to signal EOF so that the last frame |
| 73 can be returned if necessary */ | 73 can be returned if necessary */ |
| 74 int av_parser_parse(AVCodecParserContext *s, | 74 int av_parser_parse(AVCodecParserContext *s, |
| 75 AVCodecContext *avctx, | 75 AVCodecContext *avctx, |
| 76 uint8_t **poutbuf, int *poutbuf_size, | 76 uint8_t **poutbuf, int *poutbuf_size, |
| 77 const uint8_t *buf, int buf_size, | 77 const uint8_t *buf, int buf_size, |
| 78 int64_t pts, int64_t dts) | 78 int64_t pts, int64_t dts) |
| 79 { | 79 { |
| 80 int index, i, k; | 80 int index, i, k; |
| 81 uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE]; | 81 uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE]; |
| 82 | 82 |
| 83 if (buf_size == 0) { | 83 if (buf_size == 0) { |
| 84 /* padding is always necessary even if EOF, so we add it here */ | 84 /* padding is always necessary even if EOF, so we add it here */ |
| 85 memset(dummy_buf, 0, sizeof(dummy_buf)); | 85 memset(dummy_buf, 0, sizeof(dummy_buf)); |
| 86 buf = dummy_buf; | 86 buf = dummy_buf; |
| 87 } else { | 87 } else { |
| 109 if (*poutbuf_size) { | 109 if (*poutbuf_size) { |
| 110 /* fill the data for the current frame */ | 110 /* fill the data for the current frame */ |
| 111 s->frame_offset = s->last_frame_offset; | 111 s->frame_offset = s->last_frame_offset; |
| 112 s->pts = s->last_pts; | 112 s->pts = s->last_pts; |
| 113 s->dts = s->last_dts; | 113 s->dts = s->last_dts; |
| 114 | 114 |
| 115 /* offset of the next frame */ | 115 /* offset of the next frame */ |
| 116 s->last_frame_offset = s->cur_offset + index; | 116 s->last_frame_offset = s->cur_offset + index; |
| 117 /* find the packet in which the new frame starts. It | 117 /* find the packet in which the new frame starts. It |
| 118 is tricky because of MPEG video start codes | 118 is tricky because of MPEG video start codes |
| 119 which can begin in one packet and finish in | 119 which can begin in one packet and finish in |
| 127 k = (k - 1) & (AV_PARSER_PTS_NB - 1); | 127 k = (k - 1) & (AV_PARSER_PTS_NB - 1); |
| 128 } | 128 } |
| 129 | 129 |
| 130 s->last_pts = s->cur_frame_pts[k]; | 130 s->last_pts = s->cur_frame_pts[k]; |
| 131 s->last_dts = s->cur_frame_dts[k]; | 131 s->last_dts = s->cur_frame_dts[k]; |
| 132 | 132 |
| 133 /* some parsers tell us the packet size even before seeing the first byte of the next packet, | 133 /* some parsers tell us the packet size even before seeing the first byte of the next packet, |
| 134 so the next pts/dts is in the next chunk */ | 134 so the next pts/dts is in the next chunk */ |
| 135 if(index == buf_size){ | 135 if(index == buf_size){ |
| 136 s->fetch_timestamp=1; | 136 s->fetch_timestamp=1; |
| 137 } | 137 } |
| 146 * | 146 * |
| 147 * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed | 147 * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed |
| 148 */ | 148 */ |
| 149 int av_parser_change(AVCodecParserContext *s, | 149 int av_parser_change(AVCodecParserContext *s, |
| 150 AVCodecContext *avctx, | 150 AVCodecContext *avctx, |
| 151 uint8_t **poutbuf, int *poutbuf_size, | 151 uint8_t **poutbuf, int *poutbuf_size, |
| 152 const uint8_t *buf, int buf_size, int keyframe){ | 152 const uint8_t *buf, int buf_size, int keyframe){ |
| 153 | 153 |
| 154 if(s && s->parser->split){ | 154 if(s && s->parser->split){ |
| 155 if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){ | 155 if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){ |
| 156 int i= s->parser->split(avctx, buf, buf_size); | 156 int i= s->parser->split(avctx, buf, buf_size); |
| 157 buf += i; | 157 buf += i; |
| 158 buf_size -= i; | 158 buf_size -= i; |
| 167 /*||(s->pict_type != I_TYPE && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/ | 167 /*||(s->pict_type != I_TYPE && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/ |
| 168 /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){ | 168 /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){ |
| 169 int size= buf_size + avctx->extradata_size; | 169 int size= buf_size + avctx->extradata_size; |
| 170 *poutbuf_size= size; | 170 *poutbuf_size= size; |
| 171 *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); | 171 *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); |
| 172 | 172 |
| 173 memcpy(*poutbuf, avctx->extradata, avctx->extradata_size); | 173 memcpy(*poutbuf, avctx->extradata, avctx->extradata_size); |
| 174 memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 174 memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); |
| 175 return 1; | 175 return 1; |
| 176 } | 176 } |
| 177 } | 177 } |
| 244 return -1; | 244 return -1; |
| 245 } | 245 } |
| 246 | 246 |
| 247 *buf_size= | 247 *buf_size= |
| 248 pc->overread_index= pc->index + next; | 248 pc->overread_index= pc->index + next; |
| 249 | 249 |
| 250 /* append to buffer */ | 250 /* append to buffer */ |
| 251 if(pc->index){ | 251 if(pc->index){ |
| 252 pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE); | 252 pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE); |
| 253 | 253 |
| 254 memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE ); | 254 memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE ); |
| 296 | 296 |
| 297 /* XXX: merge with libavcodec ? */ | 297 /* XXX: merge with libavcodec ? */ |
| 298 #define MPEG1_FRAME_RATE_BASE 1001 | 298 #define MPEG1_FRAME_RATE_BASE 1001 |
| 299 | 299 |
| 300 static const int frame_rate_tab[16] = { | 300 static const int frame_rate_tab[16] = { |
| 301 0, | 301 0, |
| 302 24000, | 302 24000, |
| 303 24024, | 303 24024, |
| 304 25025, | 304 25025, |
| 305 30000, | 305 30000, |
| 306 30030, | 306 30030, |
| 318 25025, | 318 25025, |
| 319 25025, | 319 25025, |
| 320 }; | 320 }; |
| 321 | 321 |
| 322 //FIXME move into mpeg12.c | 322 //FIXME move into mpeg12.c |
| 323 static void mpegvideo_extract_headers(AVCodecParserContext *s, | 323 static void mpegvideo_extract_headers(AVCodecParserContext *s, |
| 324 AVCodecContext *avctx, | 324 AVCodecContext *avctx, |
| 325 const uint8_t *buf, int buf_size) | 325 const uint8_t *buf, int buf_size) |
| 326 { | 326 { |
| 327 ParseContext1 *pc = s->priv_data; | 327 ParseContext1 *pc = s->priv_data; |
| 328 const uint8_t *buf_end; | 328 const uint8_t *buf_end; |
| 384 if (bytes_left >= 5) { | 384 if (bytes_left >= 5) { |
| 385 picture_structure = buf[2]&3; | 385 picture_structure = buf[2]&3; |
| 386 top_field_first = buf[3] & (1 << 7); | 386 top_field_first = buf[3] & (1 << 7); |
| 387 repeat_first_field = buf[3] & (1 << 1); | 387 repeat_first_field = buf[3] & (1 << 1); |
| 388 progressive_frame = buf[4] & (1 << 7); | 388 progressive_frame = buf[4] & (1 << 7); |
| 389 | 389 |
| 390 /* check if we must repeat the frame */ | 390 /* check if we must repeat the frame */ |
| 391 if (repeat_first_field) { | 391 if (repeat_first_field) { |
| 392 if (pc->progressive_sequence) { | 392 if (pc->progressive_sequence) { |
| 393 if (top_field_first) | 393 if (top_field_first) |
| 394 s->repeat_pict = 4; | 394 s->repeat_pict = 4; |
| 396 s->repeat_pict = 2; | 396 s->repeat_pict = 2; |
| 397 } else if (progressive_frame) { | 397 } else if (progressive_frame) { |
| 398 s->repeat_pict = 1; | 398 s->repeat_pict = 1; |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 /* the packet only represents half a frame | 402 /* the packet only represents half a frame |
| 403 XXX,FIXME maybe find a different solution */ | 403 XXX,FIXME maybe find a different solution */ |
| 404 if(picture_structure != 3) | 404 if(picture_structure != 3) |
| 405 s->repeat_pict = -1; | 405 s->repeat_pict = -1; |
| 406 } | 406 } |
| 407 break; | 407 break; |
| 411 case -1: | 411 case -1: |
| 412 goto the_end; | 412 goto the_end; |
| 413 default: | 413 default: |
| 414 /* we stop parsing when we encounter a slice. It ensures | 414 /* we stop parsing when we encounter a slice. It ensures |
| 415 that this function takes a negligible amount of time */ | 415 that this function takes a negligible amount of time */ |
| 416 if (start_code >= SLICE_MIN_START_CODE && | 416 if (start_code >= SLICE_MIN_START_CODE && |
| 417 start_code <= SLICE_MAX_START_CODE) | 417 start_code <= SLICE_MAX_START_CODE) |
| 418 goto the_end; | 418 goto the_end; |
| 419 break; | 419 break; |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 the_end: ; | 422 the_end: ; |
| 423 } | 423 } |
| 424 | 424 |
| 425 static int mpegvideo_parse(AVCodecParserContext *s, | 425 static int mpegvideo_parse(AVCodecParserContext *s, |
| 426 AVCodecContext *avctx, | 426 AVCodecContext *avctx, |
| 427 uint8_t **poutbuf, int *poutbuf_size, | 427 uint8_t **poutbuf, int *poutbuf_size, |
| 428 const uint8_t *buf, int buf_size) | 428 const uint8_t *buf, int buf_size) |
| 429 { | 429 { |
| 430 ParseContext1 *pc1 = s->priv_data; | 430 ParseContext1 *pc1 = s->priv_data; |
| 431 ParseContext *pc= &pc1->pc; | 431 ParseContext *pc= &pc1->pc; |
| 432 int next; | 432 int next; |
| 433 | 433 |
| 434 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ | 434 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ |
| 435 next= buf_size; | 435 next= buf_size; |
| 436 }else{ | 436 }else{ |
| 437 next= ff_mpeg1_find_frame_end(pc, buf, buf_size); | 437 next= ff_mpeg1_find_frame_end(pc, buf, buf_size); |
| 438 | 438 |
| 439 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { | 439 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { |
| 440 *poutbuf = NULL; | 440 *poutbuf = NULL; |
| 441 *poutbuf_size = 0; | 441 *poutbuf_size = 0; |
| 442 return buf_size; | 442 return buf_size; |
| 443 } | 443 } |
| 444 | 444 |
| 445 } | 445 } |
| 446 /* we have a full frame : we just parse the first few MPEG headers | 446 /* we have a full frame : we just parse the first few MPEG headers |
| 447 to have the full timing information. The time take by this | 447 to have the full timing information. The time take by this |
| 448 function should be negligible for uncorrupted streams */ | 448 function should be negligible for uncorrupted streams */ |
| 449 mpegvideo_extract_headers(s, avctx, buf, buf_size); | 449 mpegvideo_extract_headers(s, avctx, buf, buf_size); |
| 450 #if 0 | 450 #if 0 |
| 451 printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n", | 451 printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n", |
| 452 s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict); | 452 s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict); |
| 453 #endif | 453 #endif |
| 454 | 454 |
| 455 *poutbuf = (uint8_t *)buf; | 455 *poutbuf = (uint8_t *)buf; |
| 456 *poutbuf_size = buf_size; | 456 *poutbuf_size = buf_size; |
| 460 static int mpegvideo_split(AVCodecContext *avctx, | 460 static int mpegvideo_split(AVCodecContext *avctx, |
| 461 const uint8_t *buf, int buf_size) | 461 const uint8_t *buf, int buf_size) |
| 462 { | 462 { |
| 463 int i; | 463 int i; |
| 464 uint32_t state= -1; | 464 uint32_t state= -1; |
| 465 | 465 |
| 466 for(i=0; i<buf_size; i++){ | 466 for(i=0; i<buf_size; i++){ |
| 467 state= (state<<8) | buf[i]; | 467 state= (state<<8) | buf[i]; |
| 468 if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100) | 468 if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100) |
| 469 return i-3; | 469 return i-3; |
| 470 } | 470 } |
| 488 | 488 |
| 489 /*************************/ | 489 /*************************/ |
| 490 | 490 |
| 491 /* used by parser */ | 491 /* used by parser */ |
| 492 /* XXX: make it use less memory */ | 492 /* XXX: make it use less memory */ |
| 493 static int av_mpeg4_decode_header(AVCodecParserContext *s1, | 493 static int av_mpeg4_decode_header(AVCodecParserContext *s1, |
| 494 AVCodecContext *avctx, | 494 AVCodecContext *avctx, |
| 495 const uint8_t *buf, int buf_size) | 495 const uint8_t *buf, int buf_size) |
| 496 { | 496 { |
| 497 ParseContext1 *pc = s1->priv_data; | 497 ParseContext1 *pc = s1->priv_data; |
| 498 MpegEncContext *s = pc->enc; | 498 MpegEncContext *s = pc->enc; |
| 528 return 0; | 528 return 0; |
| 529 } | 529 } |
| 530 | 530 |
| 531 static int mpeg4video_parse(AVCodecParserContext *s, | 531 static int mpeg4video_parse(AVCodecParserContext *s, |
| 532 AVCodecContext *avctx, | 532 AVCodecContext *avctx, |
| 533 uint8_t **poutbuf, int *poutbuf_size, | 533 uint8_t **poutbuf, int *poutbuf_size, |
| 534 const uint8_t *buf, int buf_size) | 534 const uint8_t *buf, int buf_size) |
| 535 { | 535 { |
| 536 ParseContext *pc = s->priv_data; | 536 ParseContext *pc = s->priv_data; |
| 537 int next; | 537 int next; |
| 538 | 538 |
| 539 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ | 539 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ |
| 540 next= buf_size; | 540 next= buf_size; |
| 541 }else{ | 541 }else{ |
| 542 next= ff_mpeg4_find_frame_end(pc, buf, buf_size); | 542 next= ff_mpeg4_find_frame_end(pc, buf, buf_size); |
| 543 | 543 |
| 544 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { | 544 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { |
| 545 *poutbuf = NULL; | 545 *poutbuf = NULL; |
| 546 *poutbuf_size = 0; | 546 *poutbuf_size = 0; |
| 547 return buf_size; | 547 return buf_size; |
| 548 } | 548 } |
| 557 static int mpeg4video_split(AVCodecContext *avctx, | 557 static int mpeg4video_split(AVCodecContext *avctx, |
| 558 const uint8_t *buf, int buf_size) | 558 const uint8_t *buf, int buf_size) |
| 559 { | 559 { |
| 560 int i; | 560 int i; |
| 561 uint32_t state= -1; | 561 uint32_t state= -1; |
| 562 | 562 |
| 563 for(i=0; i<buf_size; i++){ | 563 for(i=0; i<buf_size; i++){ |
| 564 state= (state<<8) | buf[i]; | 564 state= (state<<8) | buf[i]; |
| 565 if(state == 0x1B3 || state == 0x1B6) | 565 if(state == 0x1B3 || state == 0x1B6) |
| 566 return i-3; | 566 return i-3; |
| 567 } | 567 } |
| 594 return 0; | 594 return 0; |
| 595 } | 595 } |
| 596 | 596 |
| 597 static int mpegaudio_parse(AVCodecParserContext *s1, | 597 static int mpegaudio_parse(AVCodecParserContext *s1, |
| 598 AVCodecContext *avctx, | 598 AVCodecContext *avctx, |
| 599 uint8_t **poutbuf, int *poutbuf_size, | 599 uint8_t **poutbuf, int *poutbuf_size, |
| 600 const uint8_t *buf, int buf_size) | 600 const uint8_t *buf, int buf_size) |
| 601 { | 601 { |
| 602 MpegAudioParseContext *s = s1->priv_data; | 602 MpegAudioParseContext *s = s1->priv_data; |
| 603 int len, ret, sr; | 603 int len, ret, sr; |
| 604 uint32_t header; | 604 uint32_t header; |
| 652 if((header&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header) | 652 if((header&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header) |
| 653 s->header_count= -3; | 653 s->header_count= -3; |
| 654 s->header= header; | 654 s->header= header; |
| 655 s->header_count++; | 655 s->header_count++; |
| 656 s->frame_size = ret; | 656 s->frame_size = ret; |
| 657 | 657 |
| 658 #if 0 | 658 #if 0 |
| 659 /* free format: prepare to compute frame size */ | 659 /* free format: prepare to compute frame size */ |
| 660 if (decode_header(s, header) == 1) { | 660 if (decode_header(s, header) == 1) { |
| 661 s->frame_size = -1; | 661 s->frame_size = -1; |
| 662 } | 662 } |
| 663 #endif | 663 #endif |
| 664 } | 664 } |
| 665 if(s->header_count <= 0) | 665 if(s->header_count <= 0) |
| 666 avctx->sample_rate= sr; //FIXME ugly | 666 avctx->sample_rate= sr; //FIXME ugly |
| 667 } | 667 } |
| 668 } else | 668 } else |
| 669 #if 0 | 669 #if 0 |
| 670 if (s->frame_size == -1) { | 670 if (s->frame_size == -1) { |
| 671 /* free format : find next sync to compute frame size */ | 671 /* free format : find next sync to compute frame size */ |
| 672 len = MPA_MAX_CODED_FRAME_SIZE - len; | 672 len = MPA_MAX_CODED_FRAME_SIZE - len; |
| 673 if (len > buf_size) | 673 if (len > buf_size) |
| 706 padding = (header1 >> 9) & 1; | 706 padding = (header1 >> 9) & 1; |
| 707 if (s->layer == 1) | 707 if (s->layer == 1) |
| 708 s->free_format_frame_size -= padding * 4; | 708 s->free_format_frame_size -= padding * 4; |
| 709 else | 709 else |
| 710 s->free_format_frame_size -= padding; | 710 s->free_format_frame_size -= padding; |
| 711 dprintf("free frame size=%d padding=%d\n", | 711 dprintf("free frame size=%d padding=%d\n", |
| 712 s->free_format_frame_size, padding); | 712 s->free_format_frame_size, padding); |
| 713 decode_header(s, header1); | 713 decode_header(s, header1); |
| 714 goto next_data; | 714 goto next_data; |
| 715 } | 715 } |
| 716 p++; | 716 p++; |
| 718 /* not found: simply increase pointers */ | 718 /* not found: simply increase pointers */ |
| 719 buf_ptr += len; | 719 buf_ptr += len; |
| 720 s->inbuf_ptr += len; | 720 s->inbuf_ptr += len; |
| 721 buf_size -= len; | 721 buf_size -= len; |
| 722 } | 722 } |
| 723 } else | 723 } else |
| 724 #endif | 724 #endif |
| 725 if (len < s->frame_size) { | 725 if (len < s->frame_size) { |
| 726 if (s->frame_size > MPA_MAX_CODED_FRAME_SIZE) | 726 if (s->frame_size > MPA_MAX_CODED_FRAME_SIZE) |
| 727 s->frame_size = MPA_MAX_CODED_FRAME_SIZE; | 727 s->frame_size = MPA_MAX_CODED_FRAME_SIZE; |
| 728 len = s->frame_size - len; | 728 len = s->frame_size - len; |
| 732 buf_ptr += len; | 732 buf_ptr += len; |
| 733 s->inbuf_ptr += len; | 733 s->inbuf_ptr += len; |
| 734 buf_size -= len; | 734 buf_size -= len; |
| 735 } | 735 } |
| 736 // next_data: | 736 // next_data: |
| 737 if (s->frame_size > 0 && | 737 if (s->frame_size > 0 && |
| 738 (s->inbuf_ptr - s->inbuf) >= s->frame_size) { | 738 (s->inbuf_ptr - s->inbuf) >= s->frame_size) { |
| 739 if(s->header_count > 0){ | 739 if(s->header_count > 0){ |
| 740 *poutbuf = s->inbuf; | 740 *poutbuf = s->inbuf; |
| 741 *poutbuf_size = s->inbuf_ptr - s->inbuf; | 741 *poutbuf_size = s->inbuf_ptr - s->inbuf; |
| 742 } | 742 } |
| 774 return 0; | 774 return 0; |
| 775 } | 775 } |
| 776 | 776 |
| 777 static int ac3_parse(AVCodecParserContext *s1, | 777 static int ac3_parse(AVCodecParserContext *s1, |
| 778 AVCodecContext *avctx, | 778 AVCodecContext *avctx, |
| 779 uint8_t **poutbuf, int *poutbuf_size, | 779 uint8_t **poutbuf, int *poutbuf_size, |
| 780 const uint8_t *buf, int buf_size) | 780 const uint8_t *buf, int buf_size) |
| 781 { | 781 { |
| 782 AC3ParseContext *s = s1->priv_data; | 782 AC3ParseContext *s = s1->priv_data; |
| 783 const uint8_t *buf_ptr; | 783 const uint8_t *buf_ptr; |
| 784 int len, sample_rate, bit_rate; | 784 int len, sample_rate, bit_rate; |
