diff options
author | wm4 <wm4@nowhere> | 2014-03-16 01:34:48 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-16 01:38:13 +0100 |
commit | ba160f5c8455d984ae51664c1df007e5e6333b5b (patch) | |
tree | 768e810eb93b7cce8a2799f0b14094ea34eb4345 /video/decode/lavc_dr1.c | |
parent | 86689f7bf23dd05b5e6b9e42e43379d52e27c338 (diff) | |
download | mpv-ba160f5c8455d984ae51664c1df007e5e6333b5b.tar.bz2 mpv-ba160f5c8455d984ae51664c1df007e5e6333b5b.tar.xz |
vd_lavc: ridiculous workaround for Libav 9 compatibility
This "sometimes" crashed when seeking. The fault apparently lies in
libavcodec: the decoder returns an unreferenced frame! This is
completely insane, but somehow I'm apparently still expected to
work this around. As a reaction, I will drop Libav 9 support in the
next commit. (While this commit will go into release/0.3.)
Diffstat (limited to 'video/decode/lavc_dr1.c')
-rw-r--r-- | video/decode/lavc_dr1.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/video/decode/lavc_dr1.c b/video/decode/lavc_dr1.c index 03e2b5b873..f730a6c231 100644 --- a/video/decode/lavc_dr1.c +++ b/video/decode/lavc_dr1.c @@ -204,6 +204,16 @@ void mp_buffer_ref(struct FrameBuffer *buf) pool_unlock(); } +bool mp_buffer_check(struct FrameBuffer *buf) +{ + pool_lock(); + bool ok = buf->refcount > 0; + if (ok) + buf->refcount++; + pool_unlock(); + return ok; +} + void mp_buffer_unref(struct FrameBuffer *buf) { FramePool *pool = buf->pool; |