Commit 91013efa authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/image.c: no need to restart a filter when only the image size changes.

parent 7fbe765a
...@@ -137,13 +137,7 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block, ...@@ -137,13 +137,7 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
if( p_image->p_filter ) if( p_image->p_filter )
if( p_image->p_filter->fmt_in.video.i_chroma != if( p_image->p_filter->fmt_in.video.i_chroma !=
p_image->p_dec->fmt_out.video.i_chroma || p_image->p_dec->fmt_out.video.i_chroma ||
p_image->p_filter->fmt_in.video.i_width != p_image->p_filter->fmt_out.video.i_chroma != p_fmt_out->i_chroma )
p_image->p_dec->fmt_out.video.i_width ||
p_image->p_filter->fmt_in.video.i_height !=
p_image->p_dec->fmt_out.video.i_height ||
p_image->p_filter->fmt_out.video.i_chroma != p_fmt_out->i_chroma ||
p_image->p_filter->fmt_out.video.i_width != p_fmt_out->i_width ||
p_image->p_filter->fmt_out.video.i_height != p_fmt_out->i_height )
{ {
/* We need to restart a new filter */ /* We need to restart a new filter */
DeleteFilter( p_image->p_filter ); DeleteFilter( p_image->p_filter );
...@@ -163,6 +157,14 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block, ...@@ -163,6 +157,14 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
return NULL; return NULL;
} }
} }
else
{
/* Filters should handle on-the-fly size changes */
p_image->p_filter->fmt_in = p_image->p_dec->fmt_out;
p_image->p_filter->fmt_out = p_image->p_dec->fmt_out;
p_image->p_filter->fmt_out.i_codec = p_fmt_out->i_chroma;
p_image->p_filter->fmt_out.video = *p_fmt_out;
}
p_pic = p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic ); p_pic = p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic );
*p_fmt_out = p_image->p_filter->fmt_out.video; *p_fmt_out = p_image->p_filter->fmt_out.video;
......
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