Commit 8acffd0c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix render picture out-of-memory handling

parent e89f5f66
...@@ -912,6 +912,7 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced) ...@@ -912,6 +912,7 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
if (filtered && if (filtered &&
(vout->p->decoder_pool != vout->p->display_pool || subpic)) { (vout->p->decoder_pool != vout->p->display_pool || subpic)) {
picture_t *render; picture_t *render;
if (vout->p->is_decoder_pool_slow) if (vout->p->is_decoder_pool_slow)
render = picture_NewFromFormat(&vd->source); render = picture_NewFromFormat(&vd->source);
else if (vout->p->decoder_pool != vout->p->display_pool) else if (vout->p->decoder_pool != vout->p->display_pool)
...@@ -919,16 +920,23 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced) ...@@ -919,16 +920,23 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
else else
render = picture_pool_Get(vout->p->private_pool); render = picture_pool_Get(vout->p->private_pool);
if (render) { if (unlikely(render == NULL)) {
picture_Copy(render, filtered); picture_Release(filtered);
return VLC_EGENERIC;
}
picture_Copy(render, filtered);
spu_RenderSubpictures(vout->p->spu, spu_RenderSubpictures(vout->p->spu,
render, &vd->source, render, &vd->source,
subpic, &vd->source, spu_render_time); subpic, &vd->source, spu_render_time);
}
if (vout->p->is_decoder_pool_slow) { if (vout->p->is_decoder_pool_slow) {
direct = picture_pool_Get(vout->p->display_pool); direct = picture_pool_Get(vout->p->display_pool);
if (direct) if (unlikely(direct == NULL)) {
picture_Release(render);
picture_Release(filtered);
return VLC_EGENERIC;
}
picture_Copy(direct, render); picture_Copy(direct, render);
picture_Release(render); picture_Release(render);
...@@ -937,13 +945,12 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced) ...@@ -937,13 +945,12 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
} }
VideoFormatCopyCropAr(&direct->format, &filtered->format); VideoFormatCopyCropAr(&direct->format, &filtered->format);
picture_Release(filtered); picture_Release(filtered);
filtered = NULL;
} else { } else {
direct = filtered; direct = filtered;
} }
if (!direct) assert (direct != NULL);
return VLC_EGENERIC;
/* /*
* Take a snapshot if requested * Take a snapshot if requested
......
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