[MPlayer-dev-eng] AMD E450 VDPAU GPU lockup triggered by r37367/r37368 changes.

wallak at free.fr wallak at free.fr
Wed Apr 29 00:42:33 CEST 2015


Dear All,

  After extensive tests; I've found that the r37367/r37368 changes trigger a high likely GPU lock on my AMD E450 while using VDPAU. The machine may require a reboot once this happens.

  Have you an idea about the underlying issue? Is there other configurations affected?

Best Regards,
Wallak,




diff -r -u mplayer-2015-r37368/libmpcodecs/vd_ffmpeg.c mplayer-2015-r37366/libmpcodecs/vd_ffmpeg.c
--- mplayer-2010000-r37368/libmpcodecs/vd_ffmpeg.c	2015-04-28 22:59:17.000000000 +0200
+++ mplayer-2010000-r37366/libmpcodecs/vd_ffmpeg.c	2015-04-28 22:50:03.000000000 +0200
@@ -579,12 +579,7 @@
     }
 }
 
-// ignore_aspect is used to not bother with aspect changes during get_buffer.
-// The aspect can be wrong when get_buffer is called before decoding and it
-// should simply not be necessary.
-// In particular this stops spurious get_buffer aspect values from causing
-// a container value to be overwritten.
-static void update_configuration(sh_video_t *sh, enum AVPixelFormat pix_fmt, int ignore_aspect) {
+static void update_configuration(sh_video_t *sh, enum AVPixelFormat pix_fmt) {
     vd_ffmpeg_ctx *ctx = sh->context;
     AVCodecContext *avctx = ctx->avctx;
     int aspect_change = av_cmp_q(avctx->sample_aspect_ratio, ctx->last_sample_aspect_ratio);
@@ -594,7 +589,7 @@
     }
      // it is possible another vo buffers to be used after vo config()
      // lavc reset its buffers on width/heigh change but not on aspect change!!!
-    if ((!ignore_aspect && aspect_change) ||
+    if (aspect_change ||
         pix_fmt != ctx->pix_fmt ||
         !ctx->vo_initialized)
     {
@@ -603,19 +598,16 @@
         // this is a special-case HACK for MPEG-1/2 VDPAU that uses neither get_format nor
         // sets the value correctly in avcodec_open.
         set_format_params(avctx, pix_fmt);
+        mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\\n", aspect);
 
-        if (!ignore_aspect) {
-            mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\\n", aspect);
-
-            // Do not overwrite sh->original_aspect on the first call,
-            // if a container aspect is available (which is preferred then).
-            // But set it even if the sample aspect did not change, since a
-            // resolution change can cause an aspect change even if the
-            // _sample_ aspect is unchanged.
-            if (sh->original_aspect == 0 || (aspect_change && ctx->last_sample_aspect_ratio.den))
-                sh->original_aspect = aspect;
-            ctx->last_sample_aspect_ratio = avctx->sample_aspect_ratio;
-        }
+        // Do not overwrite sh->original_aspect on the first call,
+        // if a container aspect is available (which is preferred then).
+        // But set it even if the sample aspect did not change, since a
+        // resolution change can cause an aspect change even if the
+        // _sample_ aspect is unchanged.
+        if (sh->original_aspect == 0 || (aspect_change && ctx->last_sample_aspect_ratio.den))
+            sh->original_aspect = aspect;
+        ctx->last_sample_aspect_ratio = avctx->sample_aspect_ratio;
         ctx->pix_fmt = pix_fmt;
         ctx->best_csp = pixfmt2imgfmt2(pix_fmt, avctx->codec_id);
     }
@@ -630,7 +622,7 @@
     return 0;
 }
 
-static int init_vo(sh_video_t *sh, enum AVPixelFormat pix_fmt, int ignore_aspect)
+static int init_vo(sh_video_t *sh, enum AVPixelFormat pix_fmt)
 {
     vd_ffmpeg_ctx *ctx = sh->context;
     const AVCodecContext *avctx = ctx->avctx;
@@ -659,7 +651,7 @@
     if (width != sh->disp_w  || height != sh->disp_h)
         ctx->vo_initialized = 0;
 
-    update_configuration(sh, pix_fmt, ignore_aspect);
+    update_configuration(sh, pix_fmt);
     if (!ctx->vo_initialized)
     {
         sh->disp_w = width;
@@ -724,7 +716,7 @@
         type = MP_IMGTYPE_NUMBERED;
     }
 
-    if(init_vo(sh, avctx->pix_fmt, 1) < 0){
+    if(init_vo(sh, avctx->pix_fmt) < 0){
         avctx->release_buffer= avcodec_default_release_buffer;
         goto disable_dr1;
     }
@@ -1055,7 +1047,7 @@
 	    return NULL;    // skipped image
     }
 
-    if(init_vo(sh, avctx->pix_fmt, 0) < 0) return NULL;
+    if(init_vo(sh, avctx->pix_fmt) < 0) return NULL;
 
     if(dr1 && pic->opaque){
         mpi=pic->opaque;
@@ -1134,14 +1126,14 @@
         imgfmt = pixfmt2imgfmt2(fmt[i], avctx->codec_id);
         if(!IMGFMT_IS_HWACCEL(imgfmt) || !is_in_format_list(sh, imgfmt)) continue;
         mp_msg(MSGT_DECVIDEO, MSGL_V, MSGTR_MPCODECS_TryingPixfmt, i);
-        if(init_vo(sh, fmt[i], 1) >= 0) {
+        if(init_vo(sh, fmt[i]) >= 0) {
             break;
         }
     }
     selected_format = fmt[i];
     if (selected_format == PIX_FMT_NONE) {
         selected_format = avcodec_default_get_format(avctx, fmt);
-        update_configuration(sh, selected_format, 1);
+        update_configuration(sh, selected_format);
     }
     set_format_params(avctx, selected_format);
     return selected_format;


More information about the MPlayer-dev-eng mailing list