Merge commit '502cde409ca5ee97ef70c2cdede88b9101746ff6'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 6 Oct 2014 12:17:40 +0000 (14:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 6 Oct 2014 12:17:40 +0000 (14:17 +0200)
* commit '502cde409ca5ee97ef70c2cdede88b9101746ff6':
  vdpau: force reinitialization when output resolution changes

Conflicts:
libavcodec/vdpau.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/vdpau.c
libavcodec/vdpau_internal.h

@@@ -83,12 -76,9 +83,15 @@@ int ff_vdpau_common_init(AVCodecContex
      uint32_t width  = (avctx->coded_width + 1) & ~1;
      uint32_t height = (avctx->coded_height + 3) & ~3;
  
+     vdctx->width            = UINT32_MAX;
+     vdctx->height           = UINT32_MAX;
 +    if (!hwctx) {
 +        vdctx->device  = VDP_INVALID_HANDLE;
 +        av_log(avctx, AV_LOG_WARNING, "hwaccel_context has not been setup by the user application, cannot initialize\n");
 +        return 0;
 +    }
 +
      if (hwctx->context.decoder != VDP_INVALID_HANDLE) {
          vdctx->decoder = hwctx->context.decoder;
          vdctx->render  = hwctx->context.render;
@@@ -153,23 -164,14 +177,28 @@@ int ff_vdpau_common_end_frame(AVCodecCo
                                struct vdpau_picture_context *pic_ctx)
  {
      VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
 +    AVVDPAUContext *hwctx = avctx->hwaccel_context;
      VdpVideoSurface surf = ff_vdpau_get_surface_id(frame);
      VdpStatus status;
+     int val;
+     val = ff_vdpau_common_reinit(avctx);
+     if (val < 0)
+         return val;
  
 +#if FF_API_BUFS_VDPAU
 +FF_DISABLE_DEPRECATION_WARNINGS
 +    hwctx->info = pic_ctx->info;
 +    hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
 +    hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
 +    hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
 +FF_ENABLE_DEPRECATION_WARNINGS
 +#endif
 +
 +    if (!hwctx->render) {
 +        status = hwctx->render2(avctx, frame, (void *)&pic_ctx->info,
 +                                pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
 +    } else
      status = vdctx->render(vdctx->decoder, surf, (void *)&pic_ctx->info,
                             pic_ctx->bitstream_buffers_used,
                             pic_ctx->bitstream_buffers);
Simple merge