]> git.sesse.net Git - vlc/blobdiff - modules/demux/nuv.c
Use gettext_noop() consistently
[vlc] / modules / demux / nuv.c
index 35a5036b641411700b3f568976f9e0580abee5ab..8a09f5a89b7b6ae14536029fad021efe2d39c0a9 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * nuv.c:
  *****************************************************************************
- * Copyright (C) 2005 VideoLAN
- * $Id$
+ * Copyright (C) 2005 the VideoLAN team
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_plugin.h>
+#include <vlc_demux.h>
 
 /* TODO:
  *  - complete support (add support for rtjpeg and raw)
@@ -43,8 +48,8 @@ static void Close ( vlc_object_t * );
 vlc_module_begin();
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_DEMUX );
-    set_description( _("Nuv demuxer") );
-    set_capability( "demux2", 145 );
+    set_description( N_("Nuv demuxer") );
+    set_capability( "demux", 145 );
     set_callbacks( Open, Close );
     add_shortcut( "nuv" );
 vlc_module_end();
@@ -192,14 +197,14 @@ static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     frame_header_t fh;
-    vlc_bool_t  b_extended;
+    bool  b_extended;
 
     /* Check id */
     if( stream_Peek( p_demux->s, &p_peek, 12 ) != 12 ||
-        ( strncmp( p_peek, "MythTVVideo", 11 ) &&
-          strncmp( p_peek, "NuppelVideo", 11 ) ) )
+        ( strncmp( (char *)p_peek, "MythTVVideo", 11 ) &&
+          strncmp( (char *)p_peek, "NuppelVideo", 11 ) ) )
         return VLC_EGENERIC;
 
     p_sys = malloc( sizeof( demux_sys_t ) );
@@ -230,7 +235,7 @@ static int Open( vlc_object_t * p_this )
         else
         {
             /* TODO handle rtjpeg */
-            msg_Warn( p_demux, "unsuported 'D' frame (c=%c)", fh.i_compression );
+            msg_Warn( p_demux, "unsupported 'D' frame (c=%c)", fh.i_compression );
             if( stream_Read( p_demux->s, NULL, fh.i_length ) != fh.i_length )
                 goto error;
         }
@@ -241,7 +246,7 @@ static int Open( vlc_object_t * p_this )
         goto error;
     if( p_peek[0] == 'X' )
     {
-        b_extended = VLC_TRUE;
+        b_extended = true;
 
         if( FrameHeaderLoad( p_demux, &fh ) )
             goto error;
@@ -254,7 +259,7 @@ static int Open( vlc_object_t * p_this )
     }
     else
     {
-        b_extended = VLC_FALSE;
+        b_extended = false;
 
         /* XXX: for now only file with extended chunk are supported
          * why: because else we need to have support for rtjpeg+stupid nuv shit */
@@ -312,8 +317,7 @@ static void Close( vlc_object_t * p_this )
     demux_t        *p_demux = (demux_t*)p_this;
     demux_sys_t    *p_sys = p_demux->p_sys;
 
-    if( p_sys->p_extra_f )
-        free( p_sys->p_extra_f );
+    free( p_sys->p_extra_f );
     demux_IndexClean( &p_sys->idx );
     free( p_sys );
 }
@@ -640,11 +644,8 @@ static void demux_IndexInit( demux_index_t *p_idx )
 }
 static void demux_IndexClean( demux_index_t *p_idx )
 {
-    if( p_idx->idx )
-    {
-        free( p_idx->idx );
-        p_idx->idx = NULL;
-    }
+    free( p_idx->idx );
+    p_idx->idx = NULL;
 }
 static void demux_IndexAppend( demux_index_t *p_idx,
                                int64_t i_time, int64_t i_offset )