comparison flacdec.c @ 9355:54bc8a2727b0 libavcodec

Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows passing of packet-specific flags from demuxer to decoder, such as the keyframe flag, which appears necessary to playback corePNG P-frames. Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread "Google Summer of Code participation" on the mailinglist.
author rbultje
date Tue, 07 Apr 2009 15:59:50 +0000
parents eb5f74d90304
children 0dce4fe6e6f3
comparison
equal deleted inserted replaced
9354:174309386512 9355:54bc8a2727b0
634 return 0; 634 return 0;
635 } 635 }
636 636
637 static int flac_decode_frame(AVCodecContext *avctx, 637 static int flac_decode_frame(AVCodecContext *avctx,
638 void *data, int *data_size, 638 void *data, int *data_size,
639 const uint8_t *buf, int buf_size) 639 AVPacket *avpkt)
640 { 640 {
641 const uint8_t *buf = avpkt->data;
642 int buf_size = avpkt->size;
641 FLACContext *s = avctx->priv_data; 643 FLACContext *s = avctx->priv_data;
642 int i, j = 0, input_buf_size = 0, bytes_read = 0; 644 int i, j = 0, input_buf_size = 0, bytes_read = 0;
643 int16_t *samples_16 = data; 645 int16_t *samples_16 = data;
644 int32_t *samples_32 = data; 646 int32_t *samples_32 = data;
645 int alloc_data_size= *data_size; 647 int alloc_data_size= *data_size;