mirror of https://github.com/mpv-player/mpv
vd_ffmpeg: detect broken mpi usage count
Detect broken mpi usage count also in decoder. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35134 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
354b118b28
commit
1b57e80cb8
|
@ -585,6 +585,10 @@ static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic)
|
|||
if (mpi) {
|
||||
// release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU)
|
||||
mpi->usage_count--;
|
||||
if (mpi->usage_count < 0) {
|
||||
mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Bad mp_image usage count, please report!\n");
|
||||
mpi->usage_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (pic->type != FF_BUFFER_TYPE_USER) {
|
||||
|
|
Loading…
Reference in New Issue