Commit 4d2b1bd2 authored by Felix Abecassis's avatar 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
parent 37efc237
...@@ -865,6 +865,10 @@ static int DxCreateVideoDecoder(vlc_va_dxva2_t *va, ...@@ -865,6 +865,10 @@ static int DxCreateVideoDecoder(vlc_va_dxva2_t *va,
case AV_CODEC_ID_H264: case AV_CODEC_ID_H264:
surface_count = 16 + va->thread_count + 2; surface_count = 16 + va->thread_count + 2;
break; break;
case AV_CODEC_ID_MPEG1VIDEO:
case AV_CODEC_ID_MPEG2VIDEO:
surface_count = 2 + 2;
break;
default: default:
surface_count = 2 + 1; surface_count = 2 + 1;
break; break;
......
...@@ -113,7 +113,7 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count ) ...@@ -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_MPEG1VIDEO:
case AV_CODEC_ID_MPEG2VIDEO: case AV_CODEC_ID_MPEG2VIDEO:
i_profile = VAProfileMPEG2Main; i_profile = VAProfileMPEG2Main;
i_surface_count = 2+1; i_surface_count = 2 + 2;
break; break;
case AV_CODEC_ID_MPEG4: case AV_CODEC_ID_MPEG4:
i_profile = VAProfileMPEG4AdvancedSimple; i_profile = VAProfileMPEG4AdvancedSimple;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment