From 7a00bbad2100367481240e62876b941b5c4befdc Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Tue, 7 Apr 2009 15:59:50 +0000 Subject: 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. Originally committed as revision 18351 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/sp5xdec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libavcodec/sp5xdec.c') diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index 920b32d8cd..62214aadd3 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -32,8 +32,11 @@ static int sp5x_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + AVPacket avpkt_recoded; #if 0 MJpegDecodeContext *s = avctx->priv_data; #endif @@ -89,7 +92,10 @@ static int sp5x_decode_frame(AVCodecContext *avctx, recoded[j++] = 0xD9; avctx->flags &= ~CODEC_FLAG_EMU_EDGE; - i = ff_mjpeg_decode_frame(avctx, data, data_size, recoded, j); + av_init_packet(&avpkt_recoded); + avpkt_recoded.data = recoded; + avpkt_recoded.size = j; + i = ff_mjpeg_decode_frame(avctx, data, data_size, &avpkt_recoded); av_free(recoded); -- cgit v1.2.3