]> git.sesse.net Git - vlc/blobdiff - modules/packetizer/mpeg4video.c
Fix race condition while removing video outputs
[vlc] / modules / packetizer / mpeg4video.c
index 7928d495be1277ec661ad110e49052124ee22f46..449ec36d08337c5988627a3b8cc44d62198ac0e1 100644 (file)
@@ -31,7 +31,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_sout.h>
 #include <vlc_codec.h>
 #include <vlc_block.h>
@@ -49,7 +50,7 @@ static void Close( vlc_object_t * );
 vlc_module_begin();
     set_category( CAT_SOUT );
     set_subcategory( SUBCAT_SOUT_PACKETIZER );
-    set_description( _("MPEG4 video packetizer") );
+    set_description( N_("MPEG4 video packetizer") );
     set_capability( "packetizer", 50 );
     set_callbacks( Open, Close );
 vlc_module_end();
@@ -159,10 +160,7 @@ static int Open( vlc_object_t *p_this )
 
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ) ) == NULL )
-    {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     memset( p_sys, 0, sizeof(decoder_sys_t) );
 
     /* Misc init */
@@ -569,14 +567,14 @@ static int ParseVOP( decoder_t *p_dec, block_t *p_vop )
         p_dec->fmt_in.video.i_frame_rate > 0 &&
         p_dec->fmt_in.video.i_frame_rate_base > 0 )
     {
-        p_sys->i_interpolated_pts += I64C(1000000) *
+        p_sys->i_interpolated_pts += INT64_C(1000000) *
         p_dec->fmt_in.video.i_frame_rate_base *
         p_vop->i_rate / INPUT_RATE_DEFAULT /
         p_dec->fmt_in.video.i_frame_rate;
     }
     else if( p_dec->p_sys->i_fps_num )
         p_sys->i_interpolated_pts +=
-            ( I64C(1000000) * (i_time_ref + i_time_increment -
+            ( INT64_C(1000000) * (i_time_ref + i_time_increment -
               p_sys->i_last_time - p_sys->i_last_timeincr) *
               p_vop->i_rate / INPUT_RATE_DEFAULT /
               p_dec->p_sys->i_fps_num );