]> git.sesse.net Git - vlc/blobdiff - modules/codec/libmpeg2.c
Make sure we download all sources first
[vlc] / modules / codec / libmpeg2.c
index 338fbc56c207ced191179acebe5757c86859d1d5..72ea9562c7fe2b1e684bc8288b1dc3b0c16bea73 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_vout.h>
 #include <vlc_codec.h>
 
@@ -49,7 +54,7 @@ struct decoder_sys_t
      */
     mpeg2dec_t          *p_mpeg2dec;
     const mpeg2_info_t  *p_info;
-    vlc_bool_t          b_skip;
+    bool                b_skip;
 
     /*
      * Input properties
@@ -60,13 +65,13 @@ struct decoder_sys_t
     mtime_t          i_current_dts;
     int              i_current_rate;
     picture_t *      p_picture_to_destroy;
-    vlc_bool_t       b_garbage_pic;
-    vlc_bool_t       b_after_sequence_header; /* is it the next frame after
+    bool             b_garbage_pic;
+    bool             b_after_sequence_header; /* is it the next frame after
                                                * the sequence header ?    */
-    vlc_bool_t       b_slice_i;             /* intra-slice refresh stream */
-    vlc_bool_t       b_second_field;
+    bool             b_slice_i;             /* intra-slice refresh stream */
+    bool             b_second_field;
 
-    vlc_bool_t       b_preroll;
+    bool             b_preroll;
 
     /*
      * Output properties
@@ -94,7 +99,7 @@ static void GetAR( decoder_t *p_dec );
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    set_description( _("MPEG I/II video decoder (using libmpeg2)") );
+    set_description( N_("MPEG I/II video decoder (using libmpeg2)") );
     set_capability( "decoder", 150 );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_VCODEC );
@@ -125,10 +130,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys =
           (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
-    {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     /* Initialize the thread properties */
     memset( p_sys, 0, sizeof(decoder_sys_t) );
@@ -144,7 +146,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->b_slice_i  = 0;
     p_sys->b_second_field = 0;
     p_sys->b_skip     = 0;
-    p_sys->b_preroll = VLC_FALSE;
+    p_sys->b_preroll = false;
 
 #if defined( __i386__ ) || defined( __x86_64__ )
     if( vlc_CPU() & CPU_CAPABILITY_MMX )
@@ -257,11 +259,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
             if( p_block->i_flags & BLOCK_FLAG_PREROLL )
             {
-                p_sys->b_preroll = VLC_TRUE;
+                p_sys->b_preroll = true;
             }
             else if( p_sys->b_preroll )
             {
-                p_sys->b_preroll = VLC_FALSE;
+                p_sys->b_preroll = false;
                 /* Reset synchro */
                 decoder_SynchroReset( p_sys->p_synchro );
             }
@@ -321,7 +323,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             }
 
             mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic );
-        mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
+            mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
 
             /* This picture will never go through display_picture. */
             p_pic->date = 0;
@@ -477,7 +479,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             }
 
             /* For still frames */
-            if( state == STATE_END && p_pic ) p_pic->b_force = VLC_TRUE;
+            if( state == STATE_END && p_pic ) p_pic->b_force = true;
 
             if( p_pic )
             {
@@ -521,7 +523,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
                     break;
                 mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic );
-        mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
+                mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
             }
             p_sys->p_picture_to_destroy = p_pic;