Commit 6a6c23bf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout: fix picture lock/unlock with private pool

parent 37be0f0e
...@@ -133,6 +133,7 @@ VLC_USED; ...@@ -133,6 +133,7 @@ VLC_USED;
*/ */
VLC_API unsigned picture_pool_GetSize(const picture_pool_t *); VLC_API unsigned picture_pool_GetSize(const picture_pool_t *);
bool picture_pool_NeedsLocking(const picture_pool_t *);
#endif /* VLC_PICTURE_POOL_H */ #endif /* VLC_PICTURE_POOL_H */
...@@ -208,6 +208,8 @@ error: ...@@ -208,6 +208,8 @@ error:
picture_pool_t *picture_pool_Reserve(picture_pool_t *master, unsigned count) picture_pool_t *picture_pool_Reserve(picture_pool_t *master, unsigned count)
{ {
assert(master->pic_unlock == NULL);
picture_t *picture[count ? count : 1]; picture_t *picture[count ? count : 1];
unsigned i; unsigned i;
...@@ -221,8 +223,6 @@ picture_pool_t *picture_pool_Reserve(picture_pool_t *master, unsigned count) ...@@ -221,8 +223,6 @@ picture_pool_t *picture_pool_Reserve(picture_pool_t *master, unsigned count)
if (!pool) if (!pool)
goto error; goto error;
pool->pic_lock = master->pic_lock;
pool->pic_unlock = master->pic_unlock;
return pool; return pool;
error: error:
...@@ -330,3 +330,8 @@ unsigned picture_pool_GetSize(const picture_pool_t *pool) ...@@ -330,3 +330,8 @@ unsigned picture_pool_GetSize(const picture_pool_t *pool)
{ {
return pool->picture_count; return pool->picture_count;
} }
bool picture_pool_NeedsLocking(const picture_pool_t *pool)
{
return pool->pic_lock != NULL || pool->pic_unlock != NULL;
}
...@@ -133,8 +133,8 @@ int vout_InitWrapper(vout_thread_t *vout) ...@@ -133,8 +133,8 @@ int vout_InitWrapper(vout_thread_t *vout)
picture_pool_t *display_pool = picture_pool_t *display_pool =
vout_display_Pool(vd, allow_dr ? __MAX(VOUT_MAX_PICTURES, vout_display_Pool(vd, allow_dr ? __MAX(VOUT_MAX_PICTURES,
reserved_picture + decoder_picture) : 3); reserved_picture + decoder_picture) : 3);
if (allow_dr && if (allow_dr && !picture_pool_NeedsLocking(display_pool)
picture_pool_GetSize(display_pool) >= reserved_picture + decoder_picture) { && picture_pool_GetSize(display_pool) >= reserved_picture + decoder_picture) {
sys->dpb_size = picture_pool_GetSize(display_pool) - reserved_picture; sys->dpb_size = picture_pool_GetSize(display_pool) - reserved_picture;
sys->decoder_pool = display_pool; sys->decoder_pool = display_pool;
sys->display_pool = display_pool; sys->display_pool = display_pool;
......
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