]> git.sesse.net Git - vlc/blobdiff - modules/demux/pva.c
Don't include config.h from the headers - refs #297.
[vlc] / modules / demux / pva.c
index 711d117504252a8626f59bc920bb505840b8dec1..9ac9b91515a113696a41d2f0c8762d053b048d78 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * pva.c: PVA demuxer
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
- * $Id: pva.c,v 1.1 2004/01/23 17:42:10 fenrir Exp $
+ * Copyright (C) 2004 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
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
 
-#include <vlc/vlc.h>
-#include <vlc/input.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-/* TODO:
- *  - ...
- */
+#include <vlc/vlc.h>
+#include <vlc_demux.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -42,6 +41,8 @@ static void Close  ( vlc_object_t * );
 vlc_module_begin();
     set_description( _("PVA demuxer" ) );
     set_capability( "demux2", 10 );
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_DEMUX );
     set_callbacks( Open, Close );
     add_shortcut( "pva" );
 vlc_module_end();
@@ -80,21 +81,14 @@ static int Open( vlc_object_t *p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     es_format_t  fmt;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
 
-    if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 )
-    {
-        msg_Err( p_demux, "cannot peek" );
-        return VLC_EGENERIC;
-    }
+    if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
     if( p_peek[0] != 'A' || p_peek[1] != 'V' || p_peek[4] != 0x55 )
     {
         /* In case we had forced this demuxer we try to resynch */
-        if( strcasecmp( p_demux->psz_demux, "pva" ) || ReSynch( p_demux ) )
-        {
-            msg_Warn( p_demux, "PVA module discarded" );
+        if( !p_demux->b_force || ReSynch( p_demux ) )
             return VLC_EGENERIC;
-        }
     }
 
     /* Fill p_demux field */
@@ -141,7 +135,7 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     int         i_size;
     block_t     *p_frame;
     int64_t     i_pts;
@@ -328,13 +322,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             *pi64 = 0;
             return VLC_EGENERIC;
 
-        case DEMUX_SET_TIME:
 #endif
         case DEMUX_GET_FPS:
             pf = (double*)va_arg( args, double * );
             *pf = (double)1000000.0 / (double)p_sys->i_pcr_inc;
             return VLC_SUCCESS;
 #endif
+        case DEMUX_SET_TIME:
         default:
             return VLC_EGENERIC;
     }
@@ -345,7 +339,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
  *****************************************************************************/
 static int ReSynch( demux_t *p_demux )
 {
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     int      i_skip;
     int      i_peek;