Commit 0a090e33 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen Committed by Rémi Denis-Courmont

Don't store the picture_t inside of the decoder_sys_t

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent ba676907
...@@ -108,8 +108,6 @@ struct decoder_sys_t ...@@ -108,8 +108,6 @@ struct decoder_sys_t
int i_pitch; int i_pitch;
vlc_fourcc_t i_chroma; vlc_fourcc_t i_chroma;
picture_t *p_pic;
}; };
...@@ -219,8 +217,6 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -219,8 +217,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->i_pitch = pitch; p_sys->i_pitch = pitch;
p_sys->p_pic = NULL;
/* Set callbacks */ /* Set callbacks */
p_dec->pf_decode_video = DecodeBlock; p_dec->pf_decode_video = DecodeBlock;
...@@ -240,28 +236,27 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -240,28 +236,27 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{ {
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block; block_t *p_block;
picture_t* p_pic;
if( !pp_block || !*pp_block ) return NULL; if( !pp_block || !*pp_block ) return NULL;
p_block = *pp_block; p_block = *pp_block;
// create new picture // create new picture
if( p_sys->p_pic != NULL ) p_pic = decoder_NewPicture( p_dec );
picture_Release( p_sys->p_pic ); if ( !p_pic ) return NULL;
p_sys->p_pic = decoder_NewPicture( p_dec ); p_pic->b_force = true;
if ( !p_sys->p_pic ) return NULL; p_pic->p->i_pitch = p_dec->p_sys->i_pitch;
p_sys->p_pic->b_force = true; p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
p_sys->p_pic->p->i_pitch = p_dec->p_sys->i_pitch;
p_sys->p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
// lock input and copy to picture // lock input and copy to picture
p_sys->p_pic->p->p_pixels = p_sys->pf_lock( p_dec->p_sys->p_data ); p_pic->p->p_pixels = p_sys->pf_lock( p_dec->p_sys->p_data );
// unlock input // unlock input
p_sys->pf_unlock( p_dec->p_sys->p_data ); p_sys->pf_unlock( p_dec->p_sys->p_data );
block_Release( *pp_block ); *pp_block = NULL; block_Release( *pp_block ); *pp_block = NULL;
return p_sys->p_pic; return p_pic;
} }
/***************************************************************************** /*****************************************************************************
...@@ -272,8 +267,5 @@ static void CloseDecoder( vlc_object_t *p_this ) ...@@ -272,8 +267,5 @@ static void CloseDecoder( vlc_object_t *p_this )
decoder_t *p_dec = (decoder_t *)p_this; decoder_t *p_dec = (decoder_t *)p_this;
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
if( p_sys->p_pic != NULL )
picture_Release( p_sys->p_pic );
free( p_sys ); free( p_sys );
} }
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