Commit 7a7ed707 authored by Joseph Tulou's avatar Joseph Tulou Committed by Antoine Cellerier

minor changes to png and sdl_image decoders to support being called from a demuxer.

Signed-off-by: default avatarAntoine Cellerier <dionoea@videolan.org>
parent e6d4f6ab
......@@ -139,6 +139,12 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block;
p_sys->b_error = false;
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
block_Release( p_block ); *pp_block = NULL;
return NULL;
}
p_png = png_create_read_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
if( p_png == NULL )
{
......
......@@ -137,6 +137,12 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( pp_block == NULL || *pp_block == NULL ) return NULL;
p_block = *pp_block;
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
block_Release( p_block ); *pp_block = NULL;
return NULL;
}
p_rw = SDL_RWFromConstMem( p_block->p_buffer, p_block->i_buffer );
/* Decode picture. */
......@@ -257,6 +263,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
}
p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
SDL_FreeSurface( p_surface );
block_Release( p_block ); *pp_block = NULL;
return p_pic;
......
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