Commit 36644229 authored by Sam Hocevar's avatar Sam Hocevar

  * Fixed compilation with dvdcss disabled.
  * Fixed compilation with plugins disabled.
  * Removed useless variables in the VCD and DVD plugins.
  * Fixed a function which was returning "struct foo" in the VCD plugin.
  * Fixed the old � XVideo eats more and more CPU � bug I mistakenly
    reintroduced in my first vout4 commit.
parent 605a3534
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* yv12_rgb8.c : YUV to paletted RGB8 conversion module for vlc * yv12_rgb8.c : YUV to paletted RGB8 conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: yv12_rgb8.c,v 1.1 2001/12/16 16:18:36 sam Exp $ * $Id: yv12_rgb8.c,v 1.2 2001/12/19 18:14:23 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define MODULE_NAME yv12_rgb8.c #define MODULE_NAME chroma_yv12_rgb8
#include "modules_inner.h" #include "modules_inner.h"
/***************************************************************************** /*****************************************************************************
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include <string.h> /* strerror() */ #include <string.h> /* strerror() */
#include <stdlib.h> /* malloc(), free() */ #include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */ #include "common.h" /* boolean_t, byte_t */
#include "intf_msg.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dummy_dvdcss.h: Dummy libdvdcss header. * dummy_dvdcss.h: Dummy libdvdcss header.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: dummy_dvdcss.h,v 1.4 2001/11/13 01:25:05 sam Exp $ * $Id: dummy_dvdcss.h,v 1.5 2001/12/19 18:14:23 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -34,6 +34,7 @@ typedef struct dvdcss_s* dvdcss_handle; ...@@ -34,6 +34,7 @@ typedef struct dvdcss_s* dvdcss_handle;
#define DVDCSS_NOFLAGS 0 #define DVDCSS_NOFLAGS 0
#define DVDCSS_READ_DECRYPT (1 << 0) #define DVDCSS_READ_DECRYPT (1 << 0)
#define DVDCSS_SEEK_MPEG (1 << 0) #define DVDCSS_SEEK_MPEG (1 << 0)
#define DVDCSS_SEEK_KEY (1 << 1)
/***************************************************************************** /*****************************************************************************
* Exported prototypes * Exported prototypes
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.107 2001/12/19 10:00:00 massiot Exp $ * $Id: input_dvd.c,v 1.108 2001/12/19 18:14:23 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -302,9 +302,8 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -302,9 +302,8 @@ static void DVDInit( input_thread_t * p_input )
i_chapter = 1; i_chapter = 1;
} }
p_input->stream.pp_areas[i_title]->i_part = i_chapter;
p_area = p_input->stream.pp_areas[i_title]; p_area = p_input->stream.pp_areas[i_title];
p_area->i_part = i_chapter;
/* set title, chapter, audio and subpic */ /* set title, chapter, audio and subpic */
DVDSetArea( p_input, p_area ); DVDSetArea( p_input, p_area );
...@@ -849,8 +848,6 @@ static int DVDRead( input_thread_t * p_input, ...@@ -849,8 +848,6 @@ static int DVDRead( input_thread_t * p_input,
int i_pos; int i_pos;
int i_read_blocks; int i_read_blocks;
int i_sector; int i_sector;
boolean_t b_eof;
boolean_t b_eot;
boolean_t b_eoc; boolean_t b_eoc;
data_packet_t * p_data; data_packet_t * p_data;
...@@ -1002,18 +999,17 @@ intf_WarnMsg( 2, "Sector: 0x%x Read: %d Chapter: %d", p_dvd->i_sector, i_block_o ...@@ -1002,18 +999,17 @@ intf_WarnMsg( 2, "Sector: 0x%x Read: %d Chapter: %d", p_dvd->i_sector, i_block_o
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter; p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
} }
b_eot = !( p_input->stream.p_selected_area->i_tell if( p_input->stream.p_selected_area->i_tell
< p_input->stream.p_selected_area->i_size ); >= p_input->stream.p_selected_area->i_size )
b_eof = b_eot && ( ( p_dvd->i_title + 1 ) >= p_input->stream.i_area_nb );
if( b_eof )
{ {
if( ( p_dvd->i_title + 1 ) >= p_input->stream.i_area_nb )
{
/* EOF */
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
return 1; return 1;
} }
if( b_eot ) /* EOT */
{
intf_WarnMsg( 4, "dvd info: new title" ); intf_WarnMsg( 4, "dvd info: new title" );
p_dvd->i_title++; p_dvd->i_title++;
DVDSetArea( p_input, p_input->stream.pp_areas[p_dvd->i_title] ); DVDSetArea( p_input, p_input->stream.pp_areas[p_dvd->i_title] );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method * vout_sdl.c: SDL video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: vout_sdl.c,v 1.71 2001/12/19 03:50:22 sam Exp $ * $Id: vout_sdl.c,v 1.72 2001/12/19 18:14:23 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org> * Pierre Baillet <oct@zoy.org>
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "intf_msg.h" #include "intf_msg.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "netutils.h"
#include "tests.h" #include "tests.h"
#include "video.h" #include "video.h"
...@@ -196,12 +197,12 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -196,12 +197,12 @@ static int vout_Create( vout_thread_t *p_vout )
* VOUT_ASPECT_FACTOR / p_vout->render.i_aspect; * VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
} }
if( p_vout->p_sys->i_width <= 300 && p_vout->p_sys->i_height <= 200 ) if( p_vout->p_sys->i_width <= 300 && p_vout->p_sys->i_height <= 300 )
{ {
p_vout->p_sys->i_width <<= 1; p_vout->p_sys->i_width <<= 1;
p_vout->p_sys->i_height <<= 1; p_vout->p_sys->i_height <<= 1;
} }
else if( p_vout->p_sys->i_width <= 400 && p_vout->p_sys->i_height <= 300 ) else if( p_vout->p_sys->i_width <= 400 && p_vout->p_sys->i_height <= 400 )
{ {
p_vout->p_sys->i_width += p_vout->p_sys->i_width >> 1; p_vout->p_sys->i_width += p_vout->p_sys->i_width >> 1;
p_vout->p_sys->i_height += p_vout->p_sys->i_height >> 1; p_vout->p_sys->i_height += p_vout->p_sys->i_height >> 1;
......
...@@ -224,7 +224,6 @@ static void VCDInit( input_thread_t * p_input ) ...@@ -224,7 +224,6 @@ static void VCDInit( input_thread_t * p_input )
int i; int i;
input_area_t * p_area; input_area_t * p_area;
es_descriptor_t * p_es; es_descriptor_t * p_es;
packet_cache_t * p_packet_cache;
p_vcd = malloc( sizeof(thread_vcd_data_t) ); p_vcd = malloc( sizeof(thread_vcd_data_t) );
...@@ -422,7 +421,6 @@ static int VCDRead( input_thread_t * p_input, ...@@ -422,7 +421,6 @@ static int VCDRead( input_thread_t * p_input,
int i_packet_size; int i_packet_size;
int i_index; int i_index;
int i_packet; int i_packet;
boolean_t b_eof;
byte_t * p_buffer; byte_t * p_buffer;
boolean_t b_no_packet; boolean_t b_no_packet;
/* boolean_t b_eoc; No chapters yet */ /* boolean_t b_eoc; No chapters yet */
...@@ -533,7 +531,8 @@ static int VCDRead( input_thread_t * p_input, ...@@ -533,7 +531,8 @@ static int VCDRead( input_thread_t * p_input,
#endif #endif
if ( i_index + i_packet_size > BUFFER_SIZE ) if ( i_index + i_packet_size > BUFFER_SIZE )
{ {
intf_ErrMsg( "Too long packet"); intf_ErrMsg( "input error: packet too long (%i)",
i_index + i_packet_size );
continue; continue;
} }
...@@ -587,29 +586,30 @@ static int VCDRead( input_thread_t * p_input, ...@@ -587,29 +586,30 @@ static int VCDRead( input_thread_t * p_input,
p_input->stream.p_selected_area->i_part = p_vcd->i_chapter; p_input->stream.p_selected_area->i_part = p_vcd->i_chapter;
}*/ }*/
if( p_vcd->b_end_of_track )
{
input_area_t *p_area;
b_eof = p_vcd->b_end_of_track; /* EOF ? */
/*FIXME&& ( ( p_vcd->current_track ) >= p_vcd->nb_tracks - 1);*/ if( p_vcd->current_track >= p_vcd->nb_tracks - 1 )
if( b_eof )
{ {
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
return 1; return 1;
} }
if( p_vcd->b_end_of_track )
{
intf_WarnMsg( 4, "vcd info: new title" ); intf_WarnMsg( 4, "vcd info: new title" );
p_vcd->b_end_of_track = 0; p_vcd->b_end_of_track = 0;
VCDSetArea( p_input, p_input->stream.pp_areas[
p_input->stream.p_selected_area->i_id + 1] ); p_area = p_input->stream.pp_areas[
vlc_mutex_unlock( &p_input->stream.stream_lock ); p_input->stream.p_selected_area->i_id + 1 ];
return 0;
p_area->i_part = 1;
VCDSetArea( p_input, p_area );
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
return 0; return 0;
} }
......
...@@ -71,9 +71,11 @@ ...@@ -71,9 +71,11 @@
#include "modules.h" #include "modules.h"
#include "modules_export.h" #include "modules_export.h"
#include "input_vcd.h" #include "input_vcd.h"
#include "linux_cdrom_tools.h" #include "linux_cdrom_tools.h"
static void lba2msf( struct cdrom_msf0 *p_msf, int lba );
/***************************************************************************** /*****************************************************************************
* read_toc : Reads the Table of Content of a CD-ROM and fills p_vcd with * * read_toc : Reads the Table of Content of a CD-ROM and fills p_vcd with *
* the read information * * the read information *
...@@ -146,7 +148,7 @@ int VCD_sector_read ( struct thread_vcd_data_s * p_vcd, byte_t * p_buffer ) ...@@ -146,7 +148,7 @@ int VCD_sector_read ( struct thread_vcd_data_s * p_vcd, byte_t * p_buffer )
byte_t p_read_block[VCD_SECTOR_SIZE] ; byte_t p_read_block[VCD_SECTOR_SIZE] ;
struct cdrom_msf0 msf_cursor ; struct cdrom_msf0 msf_cursor ;
msf_cursor = lba2msf( p_vcd->current_sector ) ; lba2msf( &msf_cursor, p_vcd->current_sector ) ;
#ifdef DEBUG #ifdef DEBUG
intf_DbgMsg("Playing frame %d:%d-%d\n", msf_cursor.minute, intf_DbgMsg("Playing frame %d:%d-%d\n", msf_cursor.minute,
...@@ -184,16 +186,14 @@ int VCD_sector_read ( struct thread_vcd_data_s * p_vcd, byte_t * p_buffer ) ...@@ -184,16 +186,14 @@ int VCD_sector_read ( struct thread_vcd_data_s * p_vcd, byte_t * p_buffer )
* address. * address.
*****************************************************************************/ *****************************************************************************/
struct cdrom_msf0 lba2msf( int lba) static void lba2msf( struct cdrom_msf0 *p_msf, int lba )
{ {
struct cdrom_msf0 msf_result ; /* we add 2*CD_FRAMES since the 2 first seconds are not played */
/* we add 2*CD_FRAMES since the 2 first seconds are not played*/ p_msf->minute = (lba+2*CD_FRAMES) / ( CD_FRAMES * CD_SECS ) ;
p_msf->second = ( (lba+2*CD_FRAMES) % ( CD_FRAMES * CD_SECS ) )
msf_result.minute = (lba+2*CD_FRAMES) / ( CD_FRAMES * CD_SECS ) ;
msf_result.second = ( (lba+2*CD_FRAMES) % ( CD_FRAMES * CD_SECS ) )
/ CD_FRAMES ; / CD_FRAMES ;
msf_result.frame = ( (lba+2*CD_FRAMES) % ( CD_FRAMES * CD_SECS ) ) p_msf->frame = ( (lba+2*CD_FRAMES) % ( CD_FRAMES * CD_SECS ) )
% CD_FRAMES ; % CD_FRAMES ;
return msf_result ;
} }
...@@ -39,4 +39,4 @@ ...@@ -39,4 +39,4 @@
int read_toc ( struct thread_vcd_data_s *); int read_toc ( struct thread_vcd_data_s *);
int VCD_sector_read ( struct thread_vcd_data_s *, byte_t *) ; int VCD_sector_read ( struct thread_vcd_data_s *, byte_t *) ;
struct cdrom_msf0 lba2msf ( int ) ;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_common.c: Functions common to the X11 and XVideo plugins * vout_common.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: vout_common.c,v 1.5 2001/12/19 03:50:22 sam Exp $ * $Id: vout_common.c,v 1.6 2001/12/19 18:14:23 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -470,13 +470,13 @@ int _M( XCommonCreateWindow ) ( vout_thread_t *p_vout ) ...@@ -470,13 +470,13 @@ int _M( XCommonCreateWindow ) ( vout_thread_t *p_vout )
* VOUT_ASPECT_FACTOR / p_vout->render.i_aspect; * VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
} }
if( p_vout->p_sys->i_width <= 300 && p_vout->p_sys->i_height <= 200 ) if( p_vout->p_sys->i_width <= 300 && p_vout->p_sys->i_height <= 300 )
{ {
p_vout->p_sys->i_width <<= 1; p_vout->p_sys->i_width <<= 1;
p_vout->p_sys->i_height <<= 1; p_vout->p_sys->i_height <<= 1;
} }
else if( p_vout->p_sys->i_width <= 400 else if( p_vout->p_sys->i_width <= 400
&& p_vout->p_sys->i_height <= 300 ) && p_vout->p_sys->i_height <= 400 )
{ {
p_vout->p_sys->i_width += p_vout->p_sys->i_width >> 1; p_vout->p_sys->i_width += p_vout->p_sys->i_width >> 1;
p_vout->p_sys->i_height += p_vout->p_sys->i_height >> 1; p_vout->p_sys->i_height += p_vout->p_sys->i_height >> 1;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_xvideo.c: Xvideo video output display method * vout_xvideo.c: Xvideo video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: vout_xvideo.c,v 1.41 2001/12/17 19:42:16 massiot Exp $ * $Id: vout_xvideo.c,v 1.42 2001/12/19 18:14:23 sam Exp $
* *
* Authors: Shane Harper <shanegh@optusnet.com.au> * Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -382,7 +382,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -382,7 +382,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
p_pic->p_sys->p_xvimage, 0 /*src_x*/, 0 /*src_y*/, p_pic->p_sys->p_xvimage, 0 /*src_x*/, 0 /*src_y*/,
p_vout->output.i_width, p_vout->output.i_height, p_vout->output.i_width, p_vout->output.i_height,
0 /*dest_x*/, 0 /*dest_y*/, i_width, i_height, 0 /*dest_x*/, 0 /*dest_y*/, i_width, i_height,
True ); False /* Don't put True here or you'll waste your CPU */ );
XResizeWindow( p_vout->p_sys->p_display, p_vout->p_sys->yuv_window, XResizeWindow( p_vout->p_sys->p_display, p_vout->p_sys->yuv_window,
i_width, i_height ); i_width, i_height );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment