1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-18 13:14:36 +00:00

decode: fix extra surface count

FFmpeg could crash with vaapi (new) and --vo=opengl + interpolation.

It seems the actual surface count the old vaapi code uses (and which
usually never exceeded the preallocated amount) was higher than what
was used for the new vaapi code, so just correct that. The d3d helpers
also had weird code that bumped the real pool size, fix them as well.

Why this would result in an assertion failure instead of a proper error,
who knows.
This commit is contained in:
wm4 2017-02-27 14:33:18 +01:00
parent 9714e04e94
commit 6e3fbaba7e
4 changed files with 4 additions and 5 deletions

View File

@ -27,7 +27,7 @@
#include "d3d.h"
#define ADDITIONAL_SURFACES (HWDEC_EXTRA_SURFACES + HWDEC_DELAY_QUEUE_COUNT)
#define ADDITIONAL_SURFACES HWDEC_EXTRA_SURFACES
struct d3d11va_decoder {
ID3D11VideoDecoder *decoder;

View File

@ -32,7 +32,7 @@
#include "d3d.h"
#define ADDITIONAL_SURFACES (HWDEC_EXTRA_SURFACES + HWDEC_DELAY_QUEUE_COUNT)
#define ADDITIONAL_SURFACES HWDEC_EXTRA_SURFACES
struct priv {
struct mp_log *log;

View File

@ -44,7 +44,7 @@
* Note that redundant additional surfaces also might allow for some
* buffering (i.e. not trying to reuse a surface while it's busy).
*/
#define ADDTIONAL_SURFACES MPMAX(6, HWDEC_DELAY_QUEUE_COUNT)
#define ADDTIONAL_SURFACES HWDEC_EXTRA_SURFACES
// Some upper bound.
#define MAX_SURFACES 25

View File

@ -16,8 +16,7 @@
// This number might require adjustment depending on whatever the player does;
// for example, if vo_opengl increases the number of reference surfaces for
// interpolation, this value has to be increased too.
// This value does not yet include HWDEC_DELAY_QUEUE_COUNT.
#define HWDEC_EXTRA_SURFACES 4
#define HWDEC_EXTRA_SURFACES 6
struct mpv_global;