]> git.sesse.net Git - vlc/blobdiff - src/video_parser/vpar_headers.c
* Mandatory step for video output IV and the audio output quality
[vlc] / src / video_parser / vpar_headers.c
index 1798cca19617d249ddb43782e00d45cbf386fba4..779cfa9eaaf48b13be02ffd6c5012345900585be 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.c,v 1.80 2001/03/02 13:20:29 massiot Exp $
+ * $Id: vpar_headers.c,v 1.83 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -28,6 +28,7 @@
 #include "defs.h"
 
 #include <stdlib.h>                                                /* free() */
+#include <string.h>                                    /* memcpy(), memset() */
 
 #include "config.h"
 #include "common.h"
@@ -52,6 +53,8 @@
 #include "../video_decoder/video_parser.h"
 #include "../video_decoder/video_fifo.h"
 
+#include "main.h" /* XXX REMOVE THIS */
+
 /*
  * Local prototypes
  */
@@ -282,6 +285,7 @@ int vpar_ParseHeader( vpar_thread_t * p_vpar )
             break;
 
         default:
+            break;
         }
     }
 
@@ -342,7 +346,7 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
                     p_vpar->pi_default_intra_quant );
     }
 
-    if( GetBits( &p_vpar->bit_stream, 1 ) ) /* load_non_intra_quantizer_matrix */
+    if( GetBits(&p_vpar->bit_stream, 1) ) /* load_non_intra_quantizer_matrix */
     {
         LoadMatrix( p_vpar, &p_vpar->sequence.nonintra_quant );
     }
@@ -379,7 +383,8 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
         p_vpar->sequence.i_chroma_format = GetBits( &p_vpar->bit_stream, 2 );
         p_vpar->sequence.i_width |= GetBits( &p_vpar->bit_stream, 2 ) << 12;
         p_vpar->sequence.i_height |= GetBits( &p_vpar->bit_stream, 2 ) << 12;
-        /* bit_rate_extension, marker_bit, vbv_buffer_size_extension, low_delay */
+        /* bit_rate_extension, marker_bit, vbv_buffer_size_extension,
+         * low_delay */
         RemoveBits( &p_vpar->bit_stream, 22 );
         /* frame_rate_extension_n */
         i_dummy = GetBits( &p_vpar->bit_stream, 2 );
@@ -445,6 +450,13 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
 
     /* Extension and User data */
     ExtensionAndUserData( p_vpar );
+
+    /* XXX: The vout request and fifo opening will eventually be here */
+    if( p_main->p_vout == NULL )
+    {
+       intf_Msg( "vpar: no vout present, spawning one" );
+        p_main->p_vout = p_vpar->p_vout = vout_CreateThread( NULL );
+    }
 }
 
 /*****************************************************************************
@@ -691,7 +703,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
     {
         /* This is a new frame. Get a structure from the video_output. */
         while( ( P_picture = vout_CreatePicture( p_vpar->p_vout,
-                                        99+p_vpar->sequence.i_chroma_format, /*XXX??*/
+                              /* XXX */ 99+p_vpar->sequence.i_chroma_format,
                                         p_vpar->sequence.i_width,
                                         p_vpar->sequence.i_height ) )
              == NULL )
@@ -725,7 +737,8 @@ static void PictureHeader( vpar_thread_t * p_vpar )
 
 #ifdef VDEC_SMP
         /* Link referenced pictures for the decoder
-         * They are unlinked in vpar_ReleaseMacroblock() & vpar_DestroyMacroblock() */
+         * They are unlinked in vpar_ReleaseMacroblock() &
+         * vpar_DestroyMacroblock() */
         if( p_vpar->picture.i_coding_type == P_CODING_TYPE ||
             p_vpar->picture.i_coding_type == B_CODING_TYPE )
         {
@@ -910,6 +923,7 @@ static void ExtensionAndUserData( vpar_thread_t * p_vpar )
                 CopyrightExtension( p_vpar );
                 break;
             default:
+                break;
             }
             break;