[vlc-devel] commit: minor changes to png and sdl_image decoders to support being called from a demuxer . (Joseph Tulou )

git version control git at videolan.org
Sun Jan 4 19:49:44 CET 2009


vlc | branch: master | Joseph Tulou <brezhoneg1 at yahoo.fr> | Sun Jan  4 16:27:00 2009 +0100| [7a7ed7071ed0936ce7c817c6aae951c1d31d1c87] | committer: Antoine Cellerier 

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

Signed-off-by: Antoine Cellerier <dionoea at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a7ed7071ed0936ce7c817c6aae951c1d31d1c87
---

 modules/codec/png.c       |    6 ++++++
 modules/codec/sdl_image.c |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index b6c0f4e..c604f01 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -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 )
     {
diff --git a/modules/codec/sdl_image.c b/modules/codec/sdl_image.c
index 861bcb1..d4eb387 100644
--- a/modules/codec/sdl_image.c
+++ b/modules/codec/sdl_image.c
@@ -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;




More information about the vlc-devel mailing list