[vlc-devel] [PATCH] avcodec: Support hwaccel 1.2
Luca Barbato
lu_zero at gentoo.org
Wed Jul 8 13:24:31 CEST 2015
The hwaccel 1.2 can allocate by different means their buffers so the
get_buffer2 callback will not be called.
Unbreaks VDA decoding.
---
modules/codec/avcodec/video.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index c84ecb9..faeba88 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -775,8 +775,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
if( p_pic == NULL )
{
/* Get a new picture */
- if( p_sys->p_va == NULL )
- p_pic = ffmpeg_NewPictBuf( p_dec, p_context );
+ p_pic = ffmpeg_NewPictBuf( p_dec, p_context );
if( !p_pic )
{
av_frame_free(&frame);
@@ -784,7 +783,10 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
}
/* Fill picture_t from AVFrame */
- lavc_CopyPicture(p_dec, p_pic, frame);
+ if( p_sys->p_va != NULL )
+ vlc_va_Extract( p_sys->p_va, p_pic, frame->data[3] );
+ else
+ lavc_CopyPicture(p_dec, p_pic, frame);
}
else
{
--
1.9.0
More information about the vlc-devel
mailing list