<html><head></head><body>IIRC that does not work because FFmpeg could reallocate it.<br><br><div class="gmail_quote">Le 23 juillet 2019 08:57:44 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> modules/hw/vdpau/avcodec.c | 8 +++++++-<br> 1 file changed, 7 insertions(+), 1 deletion(-)<br><br>diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c<br>index 913e391562..49536e6d60 100644<br>--- a/modules/hw/vdpau/avcodec.c<br>+++ b/modules/hw/vdpau/avcodec.c<br>@@ -44,6 +44,7 @@ struct vlc_va_sys_t<br> vdp_t *vdp;<br> VdpDevice device;<br> VdpChromaType type;<br>+ void *hwaccel_context;<br> uint32_t width;<br> uint32_t height;<br> vlc_vdp_video_field_t *pool[];<br>@@ -124,7 +125,8 @@ static void Close(vlc_va_t *va, void **hwctx)<br> for (unsigned i = 0; sys->pool[i] != NULL; i++)<br> vlc_vdp_video_destroy(sys->pool[i]);<br> vdp_release_x11(sys->vdp);<br>- av_freep(hwctx);<br>+ if (sys->hwaccel_context)<br>+ av_free(sys->hwaccel_context);<br> free(sys);<br> }<br> <br>@@ -172,6 +174,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,<br> sys->type = type;<br> sys->width = width;<br> sys->height = height;<br>+ sys->hwaccel_context = NULL;<br> <br> err = vdp_get_x11(NULL, -1, &sys->vdp, &sys->device);<br> if (err != VDP_STATUS_OK)<br>@@ -189,6 +192,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,<br> <br> if (av_vdpau_bind_context(avctx, sys->device, func, flags))<br> goto error;<br>+ sys->hwaccel_context = avctx->hwaccel_context;<br> va->sys = sys;<br> <br> unsigned i = 0;<br>@@ -221,6 +225,8 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,<br> return VLC_SUCCESS;<br> <br> error:<br>+ if (sys->hwaccel_context)<br>+ av_free(sys->hwaccel_context);<br> vdp_release_x11(sys->vdp);<br> free(sys);<br> return VLC_EGENERIC;</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>