[FFmpeg-cvslog] libvorbisdec: Remove AVFrame from context

Michael Niedermayer git at videolan.org
Wed Feb 13 16:07:42 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 13 15:54:47 2013 +0100| [324d96644b571064599ecfe1f8a25f6876c6222f] | committer: Michael Niedermayer

libvorbisdec: Remove AVFrame from context

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=324d96644b571064599ecfe1f8a25f6876c6222f
---

 libavcodec/libvorbisdec.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c
index c56be29..99fb83a 100644
--- a/libavcodec/libvorbisdec.c
+++ b/libavcodec/libvorbisdec.c
@@ -25,7 +25,6 @@
 #include "internal.h"
 
 typedef struct OggVorbisDecContext {
-    AVFrame frame;
     vorbis_info vi;                     /**< vorbis_info used during init   */
     vorbis_dsp_state vd;                /**< DSP state used for analysis    */
     vorbis_block vb;                    /**< vorbis_block used for analysis */
@@ -131,6 +130,7 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
                         int *got_frame_ptr, AVPacket *avpkt)
 {
     OggVorbisDecContext *context = avccontext->priv_data ;
+    AVFrame *frame = data;
     float **pcm ;
     ogg_packet *op= &context->op;
     int samples, total_samples, total_bytes;
@@ -142,12 +142,12 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
         return 0;
     }
 
-    context->frame.nb_samples = 8192*4;
-    if ((ret = ff_get_buffer(avccontext, &context->frame)) < 0) {
+    frame->nb_samples = 8192*4;
+    if ((ret = ff_get_buffer(avccontext, frame)) < 0) {
         av_log(avccontext, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
-    output = (int16_t *)context->frame.data[0];
+    output = (int16_t *)frame->data[0];
 
 
     op->packet = avpkt->data;
@@ -172,9 +172,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
         vorbis_synthesis_read(&context->vd, samples) ;
     }
 
-    context->frame.nb_samples = total_samples;
+    frame->nb_samples = total_samples;
     *got_frame_ptr   = 1;
-    *(AVFrame *)data = context->frame;
     return avpkt->size;
 }
 



More information about the ffmpeg-cvslog mailing list