]> git.sesse.net Git - vlc/blobdiff - modules/demux/avi/avi.c
Remove unneeded msg_Err.
[vlc] / modules / demux / avi / avi.c
index 715a8af72741b4ea1b8e94ed5638a3f1d06ba00a..723aa0efdab38de562cf8f01d41d77a0f426cea4 100644 (file)
@@ -28,7 +28,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_demux.h>
 
 #include <vlc_interface.h>
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
-static int pi_index[] = {0,1,2};
+static const int pi_index[] = {0,1,2};
 
-static const char *ppsz_indexes[] = { N_("Ask"), N_("Always fix"),
+static const char *const ppsz_indexes[] = { N_("Ask"), N_("Always fix"),
                                 N_("Never fix") };
 
 vlc_module_begin();
     set_shortname( "AVI" );
-    set_description( _("AVI demuxer") );
-    set_capability( "demux2", 212 );
+    set_description( N_("AVI demuxer") );
+    set_capability( "demux", 212 );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_DEMUX );
 
@@ -355,10 +356,7 @@ static int Open( vlc_object_t * p_this )
     {
         avi_track_t           *tk     = malloc( sizeof( avi_track_t ) );
         if( !tk )
-        {
-            msg_Err( p_demux, "Out of memory" );
             goto error;
-        }
 
         avi_chunk_list_t      *p_strl = AVI_ChunkFind( p_hdrl, AVIFOURCC_strl, i );
         avi_chunk_strh_t      *p_strh = AVI_ChunkFind( p_strl, AVIFOURCC_strh, 0 );
@@ -548,10 +546,10 @@ static int Open( vlc_object_t * p_this )
                     __MIN( p_vids->p_bih->biSize - sizeof( BITMAPINFOHEADER ),
                            p_vids->i_chunk_size - sizeof(BITMAPINFOHEADER) );
                 fmt.p_extra = &p_vids->p_bih[1];
-                msg_Dbg( p_demux, "stream[%d] video(%4.4s) %dx%d %dbpp %ffps",
+                msg_Dbg( p_demux, "stream[%d] video(%4.4s) %"PRIu32"x%"PRIu32" %dbpp %ffps",
                          i, (char*)&p_vids->p_bih->biCompression,
-                         p_vids->p_bih->biWidth,
-                         p_vids->p_bih->biHeight,
+                         (uint32_t)p_vids->p_bih->biWidth,
+                         (uint32_t)p_vids->p_bih->biHeight,
                          p_vids->p_bih->biBitCount,
                          (float)tk->i_rate/(float)tk->i_scale );
 
@@ -660,9 +658,13 @@ aviindex:
                           (mtime_t)1000000 )
     {
         msg_Warn( p_demux, "broken or missing index, 'seek' will be "
-                           "axproximative or will have strange behaviour" );
+                           "approximative or will exhibit strange behavior" );
         if( i_do_index == 0 && !b_index )
         {
+            if( !p_sys->b_seekable ) {
+                b_index = true;
+                goto aviindex;
+            }
             int i_create;
             i_create = intf_UserYesNo( p_demux, _("AVI Index") ,
                         _( "This AVI file is broken. Seeking will not "
@@ -1294,7 +1296,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
 
     demux_sys_t *p_sys = p_demux->p_sys;
     unsigned int i_stream;
-    msg_Dbg( p_demux, "seek requested: "I64Fd" seconds %d%%",
+    msg_Dbg( p_demux, "seek requested: %"PRId64" seconds %d%%",
              i_date / 1000000, i_percent );
 
     if( p_sys->b_seekable )
@@ -1354,7 +1356,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
 
             i_date = AVI_GetPTS( p_stream );
             /* TODO better support for i_samplesize != 0 */
-            msg_Dbg( p_demux, "estimate date "I64Fd, i_date );
+            msg_Dbg( p_demux, "estimate date %"PRId64, i_date );
         }
 
         /* */
@@ -1368,7 +1370,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
             AVI_TrackSeek( p_demux, i_stream, i_date );
         }
         p_sys->i_time = i_date;
-        msg_Dbg( p_demux, "seek: "I64Fd" seconds", p_sys->i_time /1000000 );
+        msg_Dbg( p_demux, "seek: %"PRId64" seconds", p_sys->i_time /1000000 );
         return VLC_SUCCESS;
     }
     else
@@ -1776,7 +1778,7 @@ static int AVI_TrackSeek( demux_t *p_demux,
         }
 
         msg_Dbg( p_demux,
-                 "old:"I64Fd" %s new "I64Fd,
+                 "old:%"PRId64" %s new %"PRId64,
                  i_oldpts,
                  i_oldpts > i_date ? ">" : "<",
                  i_date );
@@ -2538,7 +2540,7 @@ static mtime_t  AVI_MovieGetLength( demux_t *p_demux )
         i_length /= (mtime_t)1000000;    /* in seconds */
 
         msg_Dbg( p_demux,
-                 "stream[%d] length:"I64Fd" (based on index)",
+                 "stream[%d] length:%"PRId64" (based on index)",
                  i,
                  i_length );
         i_maxlength = __MAX( i_maxlength, i_length );