[PATCH] minor changes to png and sdl_image decoders to support =
Joseph Tulou
brezhoneg1 at yahoo.fr
Sun Jan 4 16:27:00 CET 2009
being called from a demuxer.=0A=
=0A=
---=0A=
modules/codec/png.c | 6 ++++++=0A=
modules/codec/sdl_image.c | 8 ++++++++=0A=
2 files changed, 14 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/modules/codec/png.c b/modules/codec/png.c=0A=
index b6c0f4e..c604f01 100644=0A=
--- a/modules/codec/png.c=0A=
+++ b/modules/codec/png.c=0A=
@@ -139,6 +139,12 @@ static picture_t *DecodeBlock( decoder_t *p_dec, =
block_t **pp_block )=0A=
p_block =3D *pp_block;=0A=
p_sys->b_error =3D false;=0A=
=0A=
+ if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )=0A=
+ {=0A=
+ block_Release( p_block ); *pp_block =3D NULL;=0A=
+ return NULL;=0A=
+ }=0A=
+=0A=
p_png =3D png_create_read_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );=0A=
if( p_png =3D=3D NULL )=0A=
{=0A=
diff --git a/modules/codec/sdl_image.c b/modules/codec/sdl_image.c=0A=
index 861bcb1..d4eb387 100644=0A=
--- a/modules/codec/sdl_image.c=0A=
+++ b/modules/codec/sdl_image.c=0A=
@@ -137,6 +137,12 @@ static picture_t *DecodeBlock( decoder_t *p_dec, =
block_t **pp_block )=0A=
if( pp_block =3D=3D NULL || *pp_block =3D=3D NULL ) return NULL;=0A=
p_block =3D *pp_block;=0A=
=0A=
+ if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )=0A=
+ {=0A=
+ block_Release( p_block ); *pp_block =3D NULL;=0A=
+ return NULL;=0A=
+ }=0A=
+=0A=
p_rw =3D SDL_RWFromConstMem( p_block->p_buffer, p_block->i_buffer );=0A=
=0A=
/* Decode picture. */=0A=
@@ -257,6 +263,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, =
block_t **pp_block )=0A=
}=0A=
}=0A=
=0A=
+ p_pic->date =3D p_block->i_pts > 0 ? p_block->i_pts : =
p_block->i_dts;=0A=
+=0A=
SDL_FreeSurface( p_surface );=0A=
block_Release( p_block ); *pp_block =3D NULL;=0A=
return p_pic;=0A=
-- =0A=
1.5.2.5=0A=
=0A=
------=_NextPart_000_0001_01C96E92.FB7C7CD0
Content-Type: application/octet-stream;
name="0002-changes-Ext2Fourcc-into-image_Ext2Fourcc-and-exports.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="0002-changes-Ext2Fourcc-into-image_Ext2Fourcc-and-exports.patch"
More information about the vlc-devel
mailing list