chore: update AviRecord to comply with updated x265 API

Some patch ref: https://code.videolan.org/videolan/vlc/-/merge_requests/6167
upstream commit: c69c113960

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen 2024-10-29 19:18:20 -04:00
parent 34eb7601c4
commit a6fcb73b11
No known key found for this signature in database
GPG Key ID: 6577287BDCA70840
1 changed files with 14 additions and 0 deletions

View File

@ -460,7 +460,14 @@ static int encode_frame( unsigned char *inBuf, int width, int height )
pic->stride[1] = width/2; pic->stride[1] = width/2;
pic->stride[2] = width/2; pic->stride[2] = width/2;
#ifdef MAX_SCALABLE_LAYERS
/* Handle API changes for scalable layers output in x265 4.0 */
x265_picture *pics[MAX_SCALABLE_LAYERS] = {NULL};
pics[0] = pic;
ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, pics );
#else
ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, &pic_out ); ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, &pic_out );
#endif
if ( ret <= 0 ) if ( ret <= 0 )
{ {
@ -493,7 +500,14 @@ static int close(void)
/* Flush delayed frames */ /* Flush delayed frames */
while( hdl != NULL ) while( hdl != NULL )
{ {
#ifdef MAX_SCALABLE_LAYERS
/* Handle API changes for scalable layers output in x265 4.0 */
x265_picture *pics[MAX_SCALABLE_LAYERS] = {NULL};
pics[0] = pic;
ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, pics );
#else
ret = x265_encoder_encode( hdl, &nal, &i_nal, NULL, &pic_out ); ret = x265_encoder_encode( hdl, &nal, &i_nal, NULL, &pic_out );
#endif
if ( ret <= 0 ) if ( ret <= 0 )
{ {