Skip to content
Snippets Groups Projects
Commit 7275f933 authored by Alexandre Janniaux's avatar Alexandre Janniaux
Browse files

oldmovie: remove dynamic allocation

parent a7d548db
No related branches found
No related tags found
No related merge requests found
......@@ -114,9 +114,9 @@ typedef struct
/* general data */
bool b_init;
size_t i_planes;
int32_t *i_height;
int32_t *i_width;
int32_t *i_visible_pitch;
int32_t i_height[VOUT_MAX_PLANES];
int32_t i_width[VOUT_MAX_PLANES];
int32_t i_visible_pitch[VOUT_MAX_PLANES];
vlc_tick_t i_start_time;
vlc_tick_t i_last_time;
vlc_tick_t i_cur_time;
......@@ -311,14 +311,6 @@ static int oldmovie_allocate_data( filter_t *p_filter, picture_t *p_pic_in ) {
* take into account different characteristics for each plane
*/
p_sys->i_planes = p_pic_in->i_planes;
p_sys->i_height = calloc( p_sys->i_planes, sizeof(int32_t) );
p_sys->i_width = calloc( p_sys->i_planes, sizeof(int32_t) );
p_sys->i_visible_pitch = calloc( p_sys->i_planes, sizeof(int32_t) );
if( unlikely( !p_sys->i_height || !p_sys->i_width || !p_sys->i_visible_pitch ) ) {
oldmovie_free_allocated_data( p_filter );
return VLC_ENOMEM;
}
for (size_t i_p=0; i_p < p_sys->i_planes; i_p++) {
p_sys->i_visible_pitch [i_p] = (int) p_pic_in->p[i_p].i_visible_pitch;
......@@ -345,9 +337,6 @@ static void oldmovie_free_allocated_data( filter_t *p_filter ) {
FREENULL(p_sys->p_dust[i_d]);
p_sys->i_planes = 0;
FREENULL( p_sys->i_height );
FREENULL( p_sys->i_width );
FREENULL( p_sys->i_visible_pitch );
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment