]> git.sesse.net Git - vlc/blobdiff - modules/demux/mpeg/system.c
* Coding style cleanup: removed tabs and trailing spaces.
[vlc] / modules / demux / mpeg / system.c
index c190621189f9c7d08286cd96fbd817058b88d677..810af40b7f8d89d49e9dae972381094a4f1d4f8a 100644 (file)
@@ -2,12 +2,12 @@
  * system.c: helper module for TS, PS and PES management
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: system.c,v 1.21 2003/11/24 03:30:38 fenrir Exp $
+ * $Id: system.c,v 1.26 2003/12/22 14:32:56 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
  *          BenoĆ®t Steiner <benny@via.ecp.fr>
- *          Samuel Hocevar <sam@zoy.org>
+ *          Sam Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -170,7 +170,7 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
     if( (p_header[0] || p_header[1] || (p_header[2] != 1)) )
     {
         /* packet_start_code_prefix != 0x000001 */
-        msg_Err( p_input, "data loss, PES packet does not start with 000001" );
+        msg_Warn( p_input, "data loss, PES packet does not start with 000001" );
         input_DeletePES( p_input->p_method_data, p_pes );
         p_pes = NULL;
     }
@@ -289,7 +289,7 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
                 }
                 if( i_pes_header_size == 23 )
                 {
-                    msg_Err( p_input, "too much MPEG-1 stuffing" );
+                    msg_Warn( p_input, "too much MPEG-1 stuffing" );
                     input_DeletePES( p_input->p_method_data, p_pes );
                     p_pes = NULL;
                     return;
@@ -363,15 +363,15 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
         }
 
         /* Welcome to the kludge area ! --Meuuh */
-        if ( p_es->i_fourcc == VLC_FOURCC('a','5','2','b') )
+        if ( p_es->i_fourcc == VLC_FOURCC('a','5','2','b')
+              || p_es->i_fourcc == VLC_FOURCC('d','t','s','b') )
         {
-            /* With A/52 audio, we need to skip the first 4 bytes */
+            /* With A/52 or DTS audio, we need to skip the first 4 bytes */
             i_pes_header_size += 4;
         }
 
         if ( p_es->i_fourcc == VLC_FOURCC('l','p','c','b')
               || p_es->i_fourcc == VLC_FOURCC('s','p','u','b')
-              || p_es->i_fourcc == VLC_FOURCC('d','t','s','b')
               || p_es->i_fourcc == VLC_FOURCC('s','d','d','b') )
         {
             /* stream_private_id */
@@ -393,7 +393,7 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
             /* Go to the next data packet. */
             if( (p_data = p_data->p_next) == NULL )
             {
-                msg_Err( p_input, "PES header bigger than payload" );
+                msg_Warn( p_input, "PES header bigger than payload" );
                 input_DeletePES( p_input->p_method_data, p_pes );
                 p_pes = NULL;
                 return;
@@ -404,7 +404,7 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
         /* This last packet is partly header, partly payload. */
         if( i_payload_size < i_pes_header_size )
         {
-            msg_Err( p_input, "PES header bigger than payload" );
+            msg_Warn( p_input, "PES header bigger than payload" );
             input_DeletePES( p_input->p_method_data, p_pes );
             p_pes = NULL;
             return;
@@ -965,6 +965,29 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
                     i_fourcc = VLC_FOURCC('l','p','c','b');
                     i_cat = AUDIO_ES;
                 }
+                else if( (i_id & 0xFFFF) == 0x70BD )
+                {
+                    /* SVCD OGT subtitles in stream 0x070 */
+                    i_fourcc = VLC_FOURCC('o','g','t', ' ');
+                    i_cat = SPU_ES;
+#ifdef FINISHED_DEBUGGING
+                    if( !p_input->stream.b_seekable )
+                    if( config_GetInt( p_input, "spu-channel" )
+                           == ((i_id & 0x0300) >> 8) )
+#endif
+                    {
+                        b_auto_spawn = VLC_TRUE;
+                    }
+                }
+                else if( ((i_id >> 8) & 0xFF) <= 0x03 &&
+                         (i_id & 0x00FF) == 0x00BD )
+                {
+                    /* CVD subtitles (0x00->0x03) */
+                    i_fourcc = VLC_FOURCC('c','v','d', ' ');
+                    i_cat = SPU_ES;
+                    msg_Warn( p_input,
+                              "CVD subtitles not implemented yet" );
+                }
                 else
                 {
                     i_cat = UNKNOWN_ES;