]> git.sesse.net Git - vlc/commitdiff
* Fixed compilation with dvdcss disabled.
authorSam Hocevar <sam@videolan.org>
Wed, 19 Dec 2001 18:14:23 +0000 (18:14 +0000)
committerSam Hocevar <sam@videolan.org>
Wed, 19 Dec 2001 18:14:23 +0000 (18:14 +0000)
  * 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.

plugins/chroma/yv12_rgb8.c
plugins/dvd/dummy_dvdcss.h
plugins/dvd/input_dvd.c
plugins/sdl/vout_sdl.c
plugins/vcd/input_vcd.c
plugins/vcd/linux_cdrom_tools.c
plugins/vcd/linux_cdrom_tools.h
plugins/x11/vout_common.c
plugins/x11/vout_xvideo.c

index dad8c1a3c10284316eced5bb4474032dff86b070..f9d470e69b69cc0e6d8cf1b89ba41633d79b220c 100644 (file)
@@ -2,7 +2,7 @@
  * yv12_rgb8.c : YUV to paletted RGB8 conversion module for vlc
  *****************************************************************************
  * 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>
  *
@@ -21,7 +21,7 @@
  * 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"
 
 /*****************************************************************************
@@ -34,8 +34,8 @@
 #include <string.h>                                            /* strerror() */
 #include <stdlib.h>                                      /* malloc(), free() */
 
-#include "config.h"
 #include "common.h"                                     /* boolean_t, byte_t */
+#include "intf_msg.h"
 #include "threads.h"
 #include "mtime.h"
 
index 59190a6ebb4e909e17e5f872c41b28abb3430469..f82ae1ac4e35eaef9dcf79391e1bfaade8d42130 100644 (file)
@@ -2,7 +2,7 @@
  * dummy_dvdcss.h: Dummy libdvdcss header.
  *****************************************************************************
  * 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>
  *
@@ -34,6 +34,7 @@ typedef struct dvdcss_s* dvdcss_handle;
 #define DVDCSS_NOFLAGS         0
 #define DVDCSS_READ_DECRYPT    (1 << 0)
 #define DVDCSS_SEEK_MPEG       (1 << 0)
+#define DVDCSS_SEEK_KEY        (1 << 1)
 
 /*****************************************************************************
  * Exported prototypes
index f771789467b26d1bfe334da61025728eeb5853bb..2a726f0159839b1acabbf9c7aeab7780e8d09b5a 100644 (file)
@@ -9,7 +9,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * 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: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -302,9 +302,8 @@ static void DVDInit( input_thread_t * p_input )
         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->i_part = i_chapter;
 
     /* set title, chapter, audio and subpic */
     DVDSetArea( p_input, p_area );
@@ -849,8 +848,6 @@ static int DVDRead( input_thread_t * p_input,
     int                     i_pos;
     int                     i_read_blocks;
     int                     i_sector;
-    boolean_t               b_eof;
-    boolean_t               b_eot;
     boolean_t               b_eoc;
     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
         p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
     }
 
-    b_eot = !( p_input->stream.p_selected_area->i_tell
-                  < 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_input->stream.p_selected_area->i_tell
+            >= p_input->stream.p_selected_area->i_size )
     {
-        vlc_mutex_unlock( &p_input->stream.stream_lock );
-        return 1;
-    }
+        if( ( p_dvd->i_title + 1 ) >= p_input->stream.i_area_nb )
+        {
+            /* EOF */
+            vlc_mutex_unlock( &p_input->stream.stream_lock );
+            return 1;
+        }
 
-    if( b_eot )
-    {
+        /* EOT */
         intf_WarnMsg( 4, "dvd info: new title" );
         p_dvd->i_title++;
         DVDSetArea( p_input, p_input->stream.pp_areas[p_dvd->i_title] );
index 4bd6a2c398b4b9d33d844fcdff662e045ffa8d49..84e91e1a6740693ed2d59c90fc6ecaae58e45600 100644 (file)
@@ -2,7 +2,7 @@
  * vout_sdl.c: SDL video output display method
  *****************************************************************************
  * 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>
  *          Pierre Baillet <oct@zoy.org>
@@ -46,6 +46,7 @@
 #include "intf_msg.h"
 #include "threads.h"
 #include "mtime.h"
+#include "netutils.h"
 #include "tests.h"
 
 #include "video.h"
@@ -196,12 +197,12 @@ static int vout_Create( vout_thread_t *p_vout )
             * 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_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_height += p_vout->p_sys->i_height >> 1;
index 2a0a789671b68fb2e592079cb253ba0145e7744c..ca4cc177c5c8b3bd2a82b08d473c030f231f981e 100644 (file)
@@ -224,7 +224,6 @@ static void VCDInit( input_thread_t * p_input )
     int                  i;
     input_area_t *       p_area;
     es_descriptor_t *    p_es;
-    packet_cache_t *     p_packet_cache;
     
     p_vcd = malloc( sizeof(thread_vcd_data_t) );
         
@@ -422,7 +421,6 @@ static int VCDRead( input_thread_t * p_input,
     int                     i_packet_size;
     int                     i_index;
     int                     i_packet;   
-    boolean_t               b_eof;
     byte_t *                p_buffer;
     boolean_t                  b_no_packet;
     /* boolean_t               b_eoc; No chapters yet */
@@ -533,7 +531,8 @@ static int VCDRead( input_thread_t * p_input,
 #endif
             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;
             }
             
@@ -587,29 +586,30 @@ static int VCDRead( input_thread_t * p_input,
         p_input->stream.p_selected_area->i_part = p_vcd->i_chapter;
     }*/
 
-    
-    b_eof = p_vcd->b_end_of_track; 
-        /*FIXME&& ( ( p_vcd->current_track ) >= p_vcd->nb_tracks - 1);*/
-
-    if( b_eof )
-    {
-        vlc_mutex_unlock( &p_input->stream.stream_lock );
-        return 1;
-    }
-
     if( p_vcd->b_end_of_track )
     {
+        input_area_t *p_area;
+
+        /* EOF ? */
+        if( p_vcd->current_track >= p_vcd->nb_tracks - 1 )
+        {
+            vlc_mutex_unlock( &p_input->stream.stream_lock );
+            return 1;
+        }
+
         intf_WarnMsg( 4, "vcd info: new title" );
+
         p_vcd->b_end_of_track = 0;
-        VCDSetArea( p_input, p_input->stream.pp_areas[
-                     p_input->stream.p_selected_area->i_id + 1] );
-        vlc_mutex_unlock( &p_input->stream.stream_lock );
-        return 0;
+
+        p_area = p_input->stream.pp_areas[
+                                 p_input->stream.p_selected_area->i_id + 1 ];
+
+        p_area->i_part = 1;
+        VCDSetArea( p_input, p_area );
     }
     
     vlc_mutex_unlock( &p_input->stream.stream_lock );
 
-
     return 0;
 }
 
index e70c1325cce326ac0ece8c352815f24215ad8e22..fd573b0e7ec565384e91027d921caa4158705679 100644 (file)
 #include "modules.h"
 #include "modules_export.h"
 
-
 #include "input_vcd.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     *
 *            the read information                                            *
@@ -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] ;
     struct cdrom_msf0             msf_cursor ;
     
-    msf_cursor = lba2msf( p_vcd->current_sector ) ;
+    lba2msf( &msf_cursor, p_vcd->current_sector ) ;
    
 #ifdef DEBUG
     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 )
  *           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 */
     
-    msf_result.minute = (lba+2*CD_FRAMES) / ( CD_FRAMES * CD_SECS ) ;
-    msf_result.second = ( (lba+2*CD_FRAMES) % ( CD_FRAMES * CD_SECS ) ) 
+    p_msf->minute = (lba+2*CD_FRAMES) / ( CD_FRAMES * CD_SECS ) ;
+    p_msf->second = ( (lba+2*CD_FRAMES) % ( CD_FRAMES * CD_SECS ) ) 
         / 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 ;
-    return msf_result ;
 }
+
index f68706041d6638e2b9453d7b04e668d2c1112c82..0b895e38b13862bd6152cf2834921638e12da9d3 100644 (file)
@@ -39,4 +39,4 @@
 
 int read_toc ( struct thread_vcd_data_s *);
 int VCD_sector_read ( struct thread_vcd_data_s *, byte_t *) ;
-struct cdrom_msf0 lba2msf ( int ) ;
+
index cf178149e9946560a6340be4797eb3bda3cbc8ea..13d2f08b9b6ebaf4a64c11497299b29d1aa63640 100644 (file)
@@ -2,7 +2,7 @@
  * vout_common.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * 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>
  *          Samuel Hocevar <sam@zoy.org>
@@ -470,13 +470,13 @@ int _M( XCommonCreateWindow ) ( vout_thread_t *p_vout )
                 * 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_height <<= 1;
         }
         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_height += p_vout->p_sys->i_height >> 1;
index 74aa600fd41f882dba6c7cd0f4172cac62d668ac..8f12a60df1041655a2fdff8060f1868f832c4b62 100644 (file)
@@ -2,7 +2,7 @@
  * vout_xvideo.c: Xvideo video output display method
  *****************************************************************************
  * 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>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -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_vout->output.i_width, p_vout->output.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,
                    i_width, i_height );