]> git.sesse.net Git - vlc/blobdiff - modules/codec/sdl_image.c
Added support for explicit HeV2 LOAS/LATM stream in packetizer.
[vlc] / modules / codec / sdl_image.c
index f2b64005314b44895d11bedcd90a76a2073aa512..d4eb387ab17cf7a65ad8be146747b01bbdde7af5 100644 (file)
@@ -28,7 +28,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
 #include <vlc_vout.h>
@@ -54,15 +54,15 @@ static picture_t *DecodeBlock  ( decoder_t *, block_t ** );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-vlc_module_begin();
-    set_category( CAT_INPUT );
-    set_subcategory( SUBCAT_INPUT_VCODEC );
-    set_shortname( _("SDL Image decoder"));
-    set_description( _("SDL_image video decoder") );
-    set_capability( "decoder", 60 );
-    set_callbacks( OpenDecoder, CloseDecoder );
-    add_shortcut( "sdl_image" );
-vlc_module_end();
+vlc_module_begin ()
+    set_category( CAT_INPUT )
+    set_subcategory( SUBCAT_INPUT_VCODEC )
+    set_shortname( N_("SDL Image decoder"))
+    set_description( N_("SDL_image video decoder") )
+    set_capability( "decoder", 60 )
+    set_callbacks( OpenDecoder, CloseDecoder )
+    add_shortcut( "sdl_image" )
+vlc_module_end ()
 
 static const struct supported_fmt_t
 {
@@ -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. */
@@ -171,7 +177,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                                      / p_surface->h;
 
     /* Get a new picture. */
-    p_pic = p_dec->pf_vout_buffer_new( p_dec );
+    p_pic = decoder_NewPicture( p_dec );
     if ( p_pic == NULL ) goto error;
 
     switch ( p_surface->format->BitsPerPixel )
@@ -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;