On Wed,  9 Jan 2013 12:11:48 -0500, Justin Ruggles <[email protected]> 
wrote:
> ---
>  libavcodec/libgsm.c |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
> index b4d1c74..310185a 100644
> --- a/libavcodec/libgsm.c
> +++ b/libavcodec/libgsm.c
> @@ -143,7 +143,6 @@ AVCodec ff_libgsm_ms_encoder = {
>  };
>  
>  typedef struct LibGSMDecodeContext {
> -    AVFrame frame;
>      struct gsm_state *state;
>  } LibGSMDecodeContext;
>  
> @@ -170,9 +169,6 @@ static av_cold int libgsm_decode_init(AVCodecContext 
> *avctx) {
>          }
>      }
>  
> -    avcodec_get_frame_defaults(&s->frame);
> -    avctx->coded_frame = &s->frame;
> -
>      return 0;
>  }
>  
> @@ -189,6 +185,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, 
> void *data,
>  {
>      int i, ret;
>      LibGSMDecodeContext *s = avctx->priv_data;
> +    AVFrame *frame         = data;
>      uint8_t *buf = avpkt->data;
>      int buf_size = avpkt->size;
>      int16_t *samples;
> @@ -199,12 +196,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, 
> void *data,
>      }
>  
>      /* get output buffer */
> -    s->frame.nb_samples = avctx->frame_size;
> -    if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
> +    frame->nb_samples = avctx->frame_size;
> +    if ((ret = ff_get_buffer(avctx, frame)) < 0) {
>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>          return ret;
>      }
> -    samples = (int16_t *)s->frame.data[0];
> +    samples = (int16_t *)frame->data[0];
>  
>      for (i = 0; i < avctx->frame_size / GSM_FRAME_SIZE; i++) {
>          if ((ret = gsm_decode(s->state, buf, samples)) < 0)
> @@ -213,8 +210,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, 
> void *data,
>          samples += GSM_FRAME_SIZE;
>      }
>  
> -    *got_frame_ptr   = 1;
> -    *(AVFrame *)data = s->frame;
> +    *got_frame_ptr = 1;
>  
>      return avctx->block_align;
>  }
> -- 
> 1.7.1
> 

Ok.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to