Hi Sergej,

Thanks for the testing.

2014-03-30 13:43 GMT+02:00 Sergej Wildemann <wildem...@finf.uni-hannover.de>:
> 2014-03-28 21:28 GMT+01:00 Bálint Réczey <bal...@balintreczey.hu>:
>>
>> You could recompile mpv from experimental branch:
>> http://anonscm.debian.org/gitweb/?p=pkg-multimedia/mpv.git;a=shortlog;h=refs/heads/experimental
>>
>> I have checked VDPAU.cpp, but the most likely problem is still libav 10.
>
> I compiled mpv 0.3.3 from that branch against libav10 from
> experimental. It seems to have no problems with vdpau. The picture is
> normal and cpu usage is low as it should. Anything else that i could
> try to find the problem?
We can try two approaches. I copied what mpv does in the first patch, but
it us just a hunch and I could not test it.
Please give it a try, if it make sense to you, too.

The second patch just assert()-s when the problem happens. If the
first patch does not work, please rebuild xbmc with the second patch
without stripping the binary and try collecting the relevant variables
from the coredump.

Since mpv works libav is probably OK, thus I suspect the libav hack
compat layer is at fault in xbmc. It is not used in dmo packages
AFAIK.
Copying the author of the libav hack and the Multimedia Team in case
they can help.

This is an upstream problem, but upstream is actively discouraging
using libav and they don't give support for this use-case.

Thanks,
Balint
>
> $ mpv sample.mkv -ao null -hwdec=vdpau
...
>
> As a side note, xbmc from deb-multimedia has no problems either.
From af4f8428ecaba7eeccc916f2ca40b0c24abf23c5 Mon Sep 17 00:00:00 2001
From: Balint Reczey <bal...@balintreczey.hu>
Date: Sun, 30 Mar 2014 17:54:10 +0200
Subject: [PATCH] Fix VDPAU decoding based on mpv's vdpau_old.c

---
 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
index b4d2d38..a13b2ce 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -1049,10 +1049,10 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s,
   }
 
   VdpStatus vdp_st;
-  VdpVideoSurface surf = (VdpVideoSurface)(uintptr_t)src->data[3];
+  struct vdpau_render_state *rndr = (struct vdpau_render_state *)src->data[0];
 
   // ffmpeg vc-1 decoder does not flush, make sure the data buffer is still valid
-  if (!vdp->m_videoSurfaces.IsValid(surf))
+  if (!vdp->m_videoSurfaces.IsValid(rndr->surface))
   {
     CLog::Log(LOGWARNING, "CVDPAU::FFDrawSlice - ignoring invalid buffer");
     return;
@@ -1074,10 +1074,10 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s,
   uint16_t decoded, processed, rend;
   vdp->m_bufferStats.Get(decoded, processed, rend);
   vdp_st = vdp->m_vdpauConfig.context->GetProcs().vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder,
-                                   surf,
-                                   (VdpPictureInfo const *)&(vdp->m_hwContext.info),
-                                   vdp->m_hwContext.bitstream_buffers_used,
-                                   vdp->m_hwContext.bitstream_buffers);
+                                                                     rndr->surface,
+                                                                     (VdpPictureInfo const *)&rndr->info,
+                                                                     rndr->bitstream_buffers_used,
+                                                                     rndr->bitstream_buffers);
   vdp->CheckStatus(vdp_st, __LINE__);
   uint64_t diff = CurrentHostCounter() - startTime;
   if (diff*1000/CurrentHostFrequency() > 30)
-- 
1.7.10.4

From 1d156ee9cda78c02d39b1e4e2a2d9a6466f605fa Mon Sep 17 00:00:00 2001
From: Balint Reczey <bal...@balintreczey.hu>
Date: Sun, 30 Mar 2014 13:43:08 +0200
Subject: [PATCH] Assert when decoding fails due to #742896

---
 debian/patches/999_assert.patch |   21 +++++++++++++++++++++
 debian/patches/series           |    1 +
 2 files changed, 22 insertions(+)
 create mode 100644 debian/patches/999_assert.patch

diff --git a/debian/patches/999_assert.patch b/debian/patches/999_assert.patch
new file mode 100644
index 0000000..6829df4
--- /dev/null
+++ b/debian/patches/999_assert.patch
@@ -0,0 +1,21 @@
+diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
+index b4d2d38..b1a8cca 100644
+--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
+@@ -37,6 +37,8 @@
+ #include "DVDCodecs/DVDCodecUtils.h"
+ #include "cores/VideoRenderers/RenderFlags.h"
+ 
++#include <cassert>
++
+ using namespace VDPAU;
+ #define NUM_RENDER_PICS 7
+ 
+@@ -1079,6 +1081,7 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s,
+                                    vdp->m_hwContext.bitstream_buffers_used,
+                                    vdp->m_hwContext.bitstream_buffers);
+   vdp->CheckStatus(vdp_st, __LINE__);
++  assert(vdp_st != VDP_STATUS_INVALID_POINTER);
+   uint64_t diff = CurrentHostCounter() - startTime;
+   if (diff*1000/CurrentHostFrequency() > 30)
+     CLog::Log(LOGDEBUG, "CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend);
diff --git a/debian/patches/series b/debian/patches/series
index f1d6264..ed3644c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
 08-armel.patch
 09-use-correct-ftgl.h
 10-configure-all-arches.patch
+999_assert.patch
-- 
1.7.10.4

Reply via email to