From: Sam Hocevar Date: Wed, 13 Feb 2002 22:10:40 +0000 (+0000) Subject: * ./plugins/beos/*: BeOS fixes from Rudolf Cornelissen. X-Git-Tag: 0.3.0~197 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e8bf7fa4271c50e3732763d8754a88d50738b5e4;p=vlc * ./plugins/beos/*: BeOS fixes from Rudolf Cornelissen. * ./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. --- diff --git a/include/main.h b/include/main.h index 80687bda52..69f31794d5 100644 --- a/include/main.h +++ b/include/main.h @@ -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 * @@ -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; diff --git a/plugins/beos/aout_beos.cpp b/plugins/beos/aout_beos.cpp index 53c727bef7..59df307921 100644 --- a/plugins/beos/aout_beos.cpp +++ b/plugins/beos/aout_beos.cpp @@ -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 * Samuel Hocevar @@ -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; diff --git a/plugins/beos/vout_beos.cpp b/plugins/beos/vout_beos.cpp index e35cf0887f..3589647e61 100644 --- a/plugins/beos/vout_beos.cpp +++ b/plugins/beos/vout_beos.cpp @@ -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 * Samuel Hocevar @@ -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 ) diff --git a/plugins/mpeg_vdec/vpar_headers.c b/plugins/mpeg_vdec/vpar_headers.c index 7b6a55a7f2..ef1769b4e1 100644 --- a/plugins/mpeg_vdec/vpar_headers.c +++ b/plugins/mpeg_vdec/vpar_headers.c @@ -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 * Stéphane Borel @@ -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++; } diff --git a/plugins/vcd/input_vcd.c b/plugins/vcd/input_vcd.c index c3ef1298e0..895dce71ac 100644 --- a/plugins/vcd/input_vcd.c +++ b/plugins/vcd/input_vcd.c @@ -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 ) diff --git a/src/interface/main.c b/src/interface/main.c index b9a3761cf0..61433a4f7a 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -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 * Samuel Hocevar @@ -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 */ diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c index 9633728269..f96cabbe26 100644 --- a/src/video_output/vout_pictures.c +++ b/src/video_output/vout_pictures.c @@ -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 * Samuel Hocevar @@ -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]; } diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c index 56d8fb3f89..739795a4af 100644 --- a/src/video_output/vout_subpictures.c +++ b/src/video_output/vout_subpictures.c @@ -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 * Samuel Hocevar @@ -38,10 +38,8 @@ /***************************************************************************** * 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;