Merge pull request #766 from chenrui333/fix-x265-4.0
chore: update AviRecord to comply with updated x265 API
This commit is contained in:
commit
cd057bb13f
|
@ -461,7 +461,14 @@ static int encode_frame( unsigned char *inBuf, int width, int height )
|
|||
pic->stride[1] = 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 );
|
||||
#endif
|
||||
|
||||
if ( ret <= 0 )
|
||||
{
|
||||
|
@ -494,7 +501,14 @@ static int close(void)
|
|||
/* Flush delayed frames */
|
||||
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 );
|
||||
#endif
|
||||
|
||||
if ( ret <= 0 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue