]> git.sesse.net Git - vlc/commitdiff
* ./plugins/beos/*: BeOS fixes from Rudolf Cornelissen.
authorSam Hocevar <sam@videolan.org>
Wed, 13 Feb 2002 22:10:40 +0000 (22:10 +0000)
committerSam Hocevar <sam@videolan.org>
Wed, 13 Feb 2002 22:10:40 +0000 (22:10 +0000)
  * ./src/interface/main.c: --desync now really accepts a value in ms.
  * ./plugins/vcd/input_vcd.c: fixed a crash when not opening a VCD.
  * ./src/video_output/vout_subpictures.c: fixed subtitles under BeOS and
    other architectures which don't support overlay.

include/main.h
plugins/beos/aout_beos.cpp
plugins/beos/vout_beos.cpp
plugins/mpeg_vdec/vpar_headers.c
plugins/vcd/input_vcd.c
src/interface/main.c
src/video_output/vout_pictures.c
src/video_output/vout_subpictures.c

index 80687bda524d0c050f4a3ecabaaaa7c4099ee020..69f31794d552a5bfaa8d00faf23d8e89f966c8e5 100644 (file)
@@ -3,7 +3,7 @@
  * Declaration and extern access to global program object.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: main.h,v 1.27 2001/12/30 07:09:54 sam Exp $
+ * $Id: main.h,v 1.28 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -49,7 +49,7 @@ typedef struct main_s
     boolean_t              b_audio;             /* is audio output allowed ? */
     boolean_t              b_video;             /* is video output allowed ? */
     boolean_t              b_ac3;
-    int                    i_desync;   /* relative desync of the audio ouput */
+    mtime_t                i_desync;   /* relative desync of the audio ouput */
 
     /* Fast memcpy plugin used */
     memcpy_module_t        memcpy;
index 53c727bef712dbb5aa2d1292344b3c32eea663c1..59df307921877de9f4f02c6f5e901643aa1f6ee5 100644 (file)
@@ -2,7 +2,7 @@
  * aout_beos.cpp: BeOS audio output
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_beos.cpp,v 1.19 2002/01/28 23:08:31 stef Exp $
+ * $Id: aout_beos.cpp,v 1.20 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -121,6 +121,11 @@ static int aout_Open( aout_thread_t *p_aout )
     }
 
     /* Initialize some variables */
+    p_aout->i_format = AOUT_FORMAT_DEFAULT;
+    p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
+                                                  AOUT_STEREO_DEFAULT );
+    p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT );
+
     p_aout->p_sys->p_format->frame_rate = 44100.0;
     p_aout->p_sys->p_format->channel_count = p_aout->i_channels;
     p_aout->p_sys->p_format->format = gs_audio_format::B_GS_S16;
index e35cf0887fa78676508f99ee5ea00b621d078f06..3589647e61d61297f2a85bc30d43e6406b9a2990 100644 (file)
@@ -2,7 +2,7 @@
  * vout_beos.cpp: beos video output display method
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.39 2002/02/08 15:57:29 sam Exp $
+ * $Id: vout_beos.cpp,v 1.40 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -589,8 +589,8 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
 static int BeosOpenDisplay( vout_thread_t *p_vout )
 { 
     p_vout->p_sys->p_window = new VideoWindow(
-            main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT ) + 1,
-            main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT ) + 1,
+            main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT ) - 1,
+            main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT ) - 1,
             p_vout );
 
     if( p_vout->p_sys->p_window == NULL )
index 7b6a55a7f27ec2914464693a5d0618e488e856d5..ef1769b4e131b5d6e6f0e95c6e0d6643313a6b9d 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.12 2002/01/14 23:46:35 massiot Exp $
+ * $Id: vpar_headers.c,v 1.13 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -493,6 +493,8 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
     {
         intf_WarnMsg( 1, "vpar: no vout present, spawning one" );
 
+        vlc_mutex_unlock( &p_vout_bank->lock );
+
         p_vpar->p_vout = vout_CreateThread(
                            NULL, p_vpar->sequence.i_width,
                            p_vpar->sequence.i_height,
@@ -503,12 +505,12 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
         if( p_vpar->p_vout == NULL )
         {
             intf_ErrMsg( "vpar error: can't open vout, aborting" );
-            vlc_mutex_unlock( &p_vout_bank->lock );
-
             p_vpar->p_fifo->b_error = 1;
             return;
         }
         
+        vlc_mutex_lock( &p_vout_bank->lock );
+
         p_vout_bank->pp_vout[ p_vout_bank->i_count ] = p_vpar->p_vout;
         p_vout_bank->i_count++;
     }
index c3ef1298e03e368ef0ff785c0aa291ec90ef1944..895dce71ac2591d4bb75524b31a2ade16410130a 100644 (file)
@@ -229,6 +229,14 @@ static void VCDInit( input_thread_t * p_input )
         p_input->b_error = 1;
         return;
     }
+    else if( p_vcd->nb_tracks <= 1 )
+    {
+        intf_ErrMsg( "input error: no movie tracks found" );
+        input_BuffersEnd( p_input->p_method_data );
+        free( p_vcd );
+        p_input->b_error = 1;
+        return;
+    }
 
     p_vcd->p_sectors = ioctl_GetSectors( p_input->i_handle );
     if ( p_vcd->p_sectors == NULL )
index b9a3761cf0c72a26477f25cc207bd14bd1f575e1..61433a4f7a9f564dbe3a9e191c11c72c94efdc4c 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.148 2002/02/06 20:44:23 gbazin Exp $
+ * $Id: main.c,v 1.149 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -753,7 +753,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
             main_PutIntVariable( AOUT_VOLUME_VAR, atoi(optarg) );
             break;
         case OPT_DESYNC:                                         /* --desync */
-            p_main->i_desync = atoi(optarg);
+            p_main->i_desync = (mtime_t)atoi(optarg) * (mtime_t)1000;
             break;
 
         /* Video options */
index 9633728269afbc48cc271a52e3431c09f438fb5d..f96cabbe266837c1cdfb5cba28ac0407d535c958 100644 (file)
@@ -2,7 +2,7 @@
  * vout_pictures.c : picture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.13 2002/02/08 15:57:29 sam Exp $
+ * $Id: vout_pictures.c,v 1.14 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -327,7 +327,6 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
              * displaying it if there are subtitles. */
             if( p_subpic != NULL )
             {
-                    //printf("memcpy (refcount != 0)\n");
                 /* We have subtitles. First copy the picture to
                  * the spare direct buffer, then render the
                  * subtitles. */
@@ -341,14 +340,12 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
             /* No subtitles, picture is in a directbuffer so
              * we can display it directly even if it is still
              * in use. */
-                    //printf("direct (refcount == 0)\n");
             return p_pic;
         }
 
         /* Picture is in a direct buffer but isn't used by the
          * decoder. We can safely render subtitles on it and
          * display it. */
-                    //printf("direct (refcount == 0)\n");
         vout_RenderSubPictures( p_vout, p_pic, p_subpic );
 
         return p_pic;
@@ -361,7 +358,6 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
         /* Picture is not in a direct buffer, but is exactly the
          * same size as the direct buffers. A memcpy() is enough,
          * then render the subtitles. */
-                    //printf("memcpy (not a direct buffer)\n");
         vout_CopyPicture( p_pic, PP_OUTPUTPICTURE[0] );
 
         vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
@@ -376,11 +372,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
     /* This usually means software YUV, or hardware YUV with a
      * different chroma. */
 
-    /* XXX: render to the first direct buffer */
-                    //printf("render (not a direct buffer)\n");
-    p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
-
+    /* We render subtitles and convert image to the first direct buffer */
     vout_RenderSubPictures( p_vout, p_pic, p_subpic );
+    p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
 
     return &p_vout->p_picture[0];
 }
index 56d8fb3f8960a5c28459de1b3839d4fbc959d5a2..739795a4af81d8dd8458fd497135555405a812f5 100644 (file)
@@ -2,7 +2,7 @@
  * vout_subpictures.c : subpicture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_subpictures.c,v 1.6 2002/01/21 00:52:07 sam Exp $
+ * $Id: vout_subpictures.c,v 1.7 2002/02/13 22:10:40 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static void vout_RenderRGBSPU( const vout_thread_t *p_vout, picture_t *p_pic,
-                               const subpicture_t *p_spu );
-static void vout_RenderYUVSPU( const vout_thread_t *p_vout, picture_t *p_pic,
-                               const subpicture_t *p_spu );
+static void vout_RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
+                            const subpicture_t *p_spu );
 
 /* FIXME: fake palette - the real one has to be sought in the .IFO */
 static int p_palette[4] = { 0x0000, 0x0000, 0xffff, 0x8888 };
@@ -264,8 +262,7 @@ void vout_RenderSubPictures( vout_thread_t *p_vout, picture_t *p_pic,
         switch( p_subpic->i_type )
         {
         case DVD_SUBPICTURE:                          /* DVD subpicture unit */
-            vout_RenderRGBSPU( p_vout, p_pic, p_subpic );
-            vout_RenderYUVSPU( p_vout, p_pic, p_subpic );
+            vout_RenderSPU( p_vout, p_pic, p_subpic );
             break;
 
 #if 0
@@ -421,6 +418,7 @@ subpicture_t *vout_SortSubPictures( vout_thread_t *p_vout,
     return p_subpic;
 }
 
+#if 0  /* code removed because we should use the FOURCC value instead */
 /*****************************************************************************
  * vout_RenderRGBSPU: draw an SPU on a picture
  *****************************************************************************
@@ -432,7 +430,6 @@ subpicture_t *vout_SortSubPictures( vout_thread_t *p_vout,
 static void vout_RenderRGBSPU( const vout_thread_t *p_vout, picture_t *p_pic,
                                const subpicture_t *p_spu )
 {
-#if 0
     int  i_len, i_color;
     u16 *p_source = (u16 *)p_spu->p_data;
 
@@ -526,19 +523,19 @@ static void vout_RenderRGBSPU( const vout_thread_t *p_vout, picture_t *p_pic,
             }
         }
     }
-#endif
 }
+#endif
 
 /*****************************************************************************
- * vout_RenderYUVSPU: draw an SPU on an YUV overlay
+ * vout_RenderSPU: draw an SPU on an YUV overlay
  *****************************************************************************
  * This is a fast implementation of the subpicture drawing code. The data
  * has been preprocessed once in spu_decoder.c, so we don't need to parse the
  * RLE buffer again and again. Most sanity checks are done in spu_decoder.c
  * so that this routine can be as fast as possible.
  *****************************************************************************/
-static void vout_RenderYUVSPU( const vout_thread_t *p_vout, picture_t *p_pic,
-                               const subpicture_t *p_spu )
+static void vout_RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
+                            const subpicture_t *p_spu )
 {
     int  i_len, i_color;
     u16 *p_source = (u16 *)p_spu->p_data;