[vlc-commits] avcodec: allocate one additional hardware surface for MPEG-2

Felix Abecassis git at videolan.org
Thu Mar 6 10:32:58 CET 2014


vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Wed Mar  5 16:48:46 2014 +0100| [4d2b1bd21d9626b19c697c75fb67b14dd88c9367] | committer: Felix Abecassis

avcodec: allocate one additional hardware surface for MPEG-2

Required to avoid visual glitches when running out of free surfaces
with avcodec and vaapi/dxva2 backends.

Fix #10868

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d2b1bd21d9626b19c697c75fb67b14dd88c9367
---

 modules/codec/avcodec/dxva2.c |    4 ++++
 modules/codec/avcodec/vaapi.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index f3a1524..85d6f4a 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -865,6 +865,10 @@ static int DxCreateVideoDecoder(vlc_va_dxva2_t *va,
     case AV_CODEC_ID_H264:
         surface_count = 16 + va->thread_count + 2;
         break;
+    case AV_CODEC_ID_MPEG1VIDEO:
+    case AV_CODEC_ID_MPEG2VIDEO:
+        surface_count = 2 + 2;
+        break;
     default:
         surface_count = 2 + 1;
         break;
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 14fc83d..88023f3 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -113,7 +113,7 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
     case AV_CODEC_ID_MPEG1VIDEO:
     case AV_CODEC_ID_MPEG2VIDEO:
         i_profile = VAProfileMPEG2Main;
-        i_surface_count = 2+1;
+        i_surface_count = 2 + 2;
         break;
     case AV_CODEC_ID_MPEG4:
         i_profile = VAProfileMPEG4AdvancedSimple;



More information about the vlc-commits mailing list