Merge commit 'ff953fecffd3b9a616a046723fb9d4690be032a6'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 5 Dec 2012 14:52:16 +0000 (15:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 5 Dec 2012 14:58:07 +0000 (15:58 +0100)
* commit 'ff953fecffd3b9a616a046723fb9d4690be032a6':
  lavc: set frame properties in ff_get_buffer().

Conflicts:
libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
cmdutils.c
libavcodec/utils.c

diff --cc cmdutils.c
Simple merge
@@@ -587,6 -508,24 +581,26 @@@ int avcodec_default_get_buffer(AVCodecC
  
  int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
  {
+     switch (avctx->codec_type) {
+     case AVMEDIA_TYPE_VIDEO:
+         frame->width               = avctx->width;
+         frame->height              = avctx->height;
+         frame->format              = avctx->pix_fmt;
+         frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
+         break;
+     case AVMEDIA_TYPE_AUDIO:
+         frame->sample_rate    = avctx->sample_rate;
+         frame->format         = avctx->sample_fmt;
+         frame->channel_layout = avctx->channel_layout;
+         break;
+     default: return AVERROR(EINVAL);
+     }
+     frame->pkt_pts = avctx->pkt ? avctx->pkt->pts : AV_NOPTS_VALUE;
+     frame->reordered_opaque = avctx->reordered_opaque;
++    ff_init_buffer_info(avctx, frame);
++
      return avctx->get_buffer(avctx, frame);
  }
  
@@@ -2681,9 -2155,6 +2695,7 @@@ unsigned int avpriv_toupper4(unsigned i
  int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
  {
      f->owner = avctx;
-     ff_init_buffer_info(avctx, f);
 +
      return ff_get_buffer(avctx, f);
  }