1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-27 02:40:53 +00:00

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:
reimar 2012-08-31 20:08:44 +00:00 committed by wm4
parent 354b118b28
commit 1b57e80cb8

View File

@ -585,6 +585,10 @@ static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic)
if (mpi) { if (mpi) {
// release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU) // release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU)
mpi->usage_count--; 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) { if (pic->type != FF_BUFFER_TYPE_USER) {