comparison g726.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 4cb7c65fc775
comparison
equal deleted inserted replaced
9354:174309386512 9355:54bc8a2727b0
361 } 361 }
362 #endif 362 #endif
363 363
364 static int g726_decode_frame(AVCodecContext *avctx, 364 static int g726_decode_frame(AVCodecContext *avctx,
365 void *data, int *data_size, 365 void *data, int *data_size,
366 const uint8_t *buf, int buf_size) 366 AVPacket *avpkt)
367 { 367 {
368 const uint8_t *buf = avpkt->data;
369 int buf_size = avpkt->size;
368 G726Context *c = avctx->priv_data; 370 G726Context *c = avctx->priv_data;
369 short *samples = data; 371 short *samples = data;
370 GetBitContext gb; 372 GetBitContext gb;
371 373
372 init_get_bits(&gb, buf, buf_size * 8); 374 init_get_bits(&gb, buf, buf_size * 8);