diff dsicinav.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 e9d9d946f213
children 8a4984c5cacc
line wrap: on
line diff
--- a/dsicinav.c	Tue Apr 07 15:37:26 2009 +0000
+++ b/dsicinav.c	Tue Apr 07 15:59:50 2009 +0000
@@ -195,8 +195,10 @@
 
 static int cinvideo_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;
     CinVideoContext *cin = avctx->priv_data;
     int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size;
 
@@ -312,8 +314,10 @@
 
 static int cinaudio_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;
     CinAudioContext *cin = avctx->priv_data;
     const uint8_t *src = buf;
     int16_t *samples = (int16_t *)data;