Mercurial > libavcodec.hg
comparison ac3dec.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 | 04423b2f6e0b |
children | 7db61b0d21f9 |
comparison
equal
deleted
inserted
replaced
9354:174309386512 | 9355:54bc8a2727b0 |
---|---|
1224 | 1224 |
1225 /** | 1225 /** |
1226 * Decode a single AC-3 frame. | 1226 * Decode a single AC-3 frame. |
1227 */ | 1227 */ |
1228 static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size, | 1228 static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size, |
1229 const uint8_t *buf, int buf_size) | 1229 AVPacket *avpkt) |
1230 { | 1230 { |
1231 const uint8_t *buf = avpkt->data; | |
1232 int buf_size = avpkt->size; | |
1231 AC3DecodeContext *s = avctx->priv_data; | 1233 AC3DecodeContext *s = avctx->priv_data; |
1232 int16_t *out_samples = (int16_t *)data; | 1234 int16_t *out_samples = (int16_t *)data; |
1233 int blk, ch, err; | 1235 int blk, ch, err; |
1234 | 1236 |
1235 /* initialize the GetBitContext with the start of valid AC-3 Frame */ | 1237 /* initialize the GetBitContext with the start of valid AC-3 Frame */ |