]> git.sesse.net Git - vlc/blobdiff - modules/demux/rawvid.c
Improved ac3/eac3 support in mp4 (fix #2524).
[vlc] / modules / demux / rawvid.c
index 706b97bee162ee486ab7f72fff017e7ca0445a42..22ded17b8e4ce979880fc7cdc50781fbc172f88c 100644 (file)
@@ -34,6 +34,7 @@
 #include <vlc_plugin.h>
 #include <vlc_demux.h>
 #include <vlc_vout.h>                                     /* vout_InitFormat */
+#include <assert.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -72,9 +73,9 @@ vlc_module_begin ()
     add_integer( "rawvid-width", 0, 0, WIDTH_TEXT, WIDTH_LONGTEXT, 0 )
     add_integer( "rawvid-height", 0, 0, HEIGHT_TEXT, HEIGHT_LONGTEXT, 0 )
     add_string( "rawvid-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
-                true );
+                true )
     add_string( "rawvid-aspect-ratio", NULL, NULL,
-                ASPECT_RATIO_TEXT, ASPECT_RATIO_LONGTEXT, true );
+                ASPECT_RATIO_TEXT, ASPECT_RATIO_LONGTEXT, true )
 vlc_module_end ()
 
 /*****************************************************************************
@@ -379,8 +380,7 @@ static int Open( vlc_object_t * p_this )
     return VLC_SUCCESS;
 
 error:
-    if( p_sys )
-        free( p_sys );
+    free( p_sys );
     return VLC_EGENERIC;
 }
 
@@ -446,12 +446,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 {
     demux_sys_t *p_sys  = p_demux->p_sys;
 
-    /* NB, demux_vaControlHelper only takes int for i_bps currently;
-     * (2**31)-1 is insufficient to store 1080p50 4:4:4. */
-    int64_t i_bps = 8LL * p_sys->frame_size * p_sys->pcr.i_divider_num
-                  / p_sys->pcr.i_divider_den;
+     /* (2**31)-1 is insufficient to store 1080p50 4:4:4. */
+    const int64_t i_bps = 8LL * p_sys->frame_size * p_sys->pcr.i_divider_num /
+                                                    p_sys->pcr.i_divider_den;
 
     /* XXX: DEMUX_SET_TIME is precise here */
     return demux_vaControlHelper( p_demux->s, 0, -1, i_bps,
                                    p_sys->frame_size, i_query, args );
 }
+