]> git.sesse.net Git - vlc/commitdiff
* modules/demux/util/sub.c: fix when no subs specified.
authorGildas Bazin <gbazin@videolan.org>
Wed, 8 Oct 2003 21:03:36 +0000 (21:03 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 8 Oct 2003 21:03:36 +0000 (21:03 +0000)
* modules/video_output/x11/xcommon.c: fixed invalid chroma.
* modules/codec/a52.c, modules/codec/libmpeg2.c: small cleanup.

modules/codec/a52.c
modules/codec/libmpeg2.c
modules/demux/util/sub.c
modules/video_output/x11/xcommon.c

index 2efc9e143096dbd3f457f01895b10caeadf008c4..e89410177f75e10f43e8267e4d310e76c7dd0425 100644 (file)
@@ -2,7 +2,7 @@
  * a52.c: A/52 basic parser
  *****************************************************************************
  * Copyright (C) 2001-2002 VideoLAN
- * $Id: a52.c,v 1.26 2003/10/01 18:32:13 gbazin Exp $
+ * $Id: a52.c,v 1.27 2003/10/08 21:03:36 gbazin Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Christophe Massiot <massiot@via.ecp.fr>
 #include <vlc/aout.h>
 #include <vlc/sout.h>
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
 #include "vlc_block_helper.h"
 
 #define A52_HEADER_SIZE 7
index 6747d4a5ffa712c29fa76af2f231f34bdea98b80..ce3b190a50ed2f015b3c8cce53330279ba53328e 100755 (executable)
@@ -2,7 +2,7 @@
  * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: libmpeg2.c,v 1.29 2003/10/01 22:40:39 hartman Exp $
+ * $Id: libmpeg2.c,v 1.30 2003/10/08 21:03:36 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -62,7 +62,6 @@ struct decoder_sys_t
     mtime_t          i_pts;
     mtime_t          i_previous_pts;
     mtime_t          i_current_pts;
-    mtime_t          i_period_remainder;
     int              i_current_rate;
     picture_t *      p_picture_to_destroy;
     vlc_bool_t       b_garbage_pic;
@@ -81,10 +80,10 @@ struct decoder_sys_t
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static int  OpenDecoder  ( vlc_object_t * );
-static int  InitDecoder  ( decoder_t * );
-static int  RunDecoder   ( decoder_t *, block_t * );
-static int  EndDecoder   ( decoder_t * );
+static int OpenDecoder( vlc_object_t * );
+static int InitDecoder( decoder_t * );
+static int RunDecoder ( decoder_t *, block_t * );
+static int EndDecoder ( decoder_t * );
 
 static picture_t *GetNewPicture( decoder_t *, uint8_t ** );
 
@@ -107,8 +106,10 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('m','p','g','v') &&
         p_dec->p_fifo->i_fourcc != VLC_FOURCC('m','p','g','1') &&
-        p_dec->p_fifo->i_fourcc != VLC_FOURCC('P','I','M','1') && /* Pinnacle hardware-mpeg1 */
-        p_dec->p_fifo->i_fourcc != VLC_FOURCC('V','C','R','2') && /* ATI Video */
+        /* Pinnacle hardware-mpeg1 */
+        p_dec->p_fifo->i_fourcc != VLC_FOURCC('P','I','M','1') &&
+        /* ATI Video */
+        p_dec->p_fifo->i_fourcc != VLC_FOURCC('V','C','R','2') &&
         p_dec->p_fifo->i_fourcc != VLC_FOURCC('m','p','g','2') )
     {
         return VLC_EGENERIC;
@@ -144,7 +145,6 @@ static int InitDecoder( decoder_t *p_dec )
     p_dec->p_sys->i_pts      = mdate() + DEFAULT_PTS_DELAY;
     p_dec->p_sys->i_current_pts  = 0;
     p_dec->p_sys->i_previous_pts = 0;
-    p_dec->p_sys->i_period_remainder = 0;
     p_dec->p_sys->p_picture_to_destroy = NULL;
     p_dec->p_sys->b_garbage_pic = 0;
     p_dec->p_sys->b_slice_i  = 0;
@@ -565,28 +565,27 @@ static int EndDecoder( decoder_t * p_dec )
 static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
-
     picture_t *p_pic;
+
     vlc_bool_t b_progressive = p_sys->p_info->current_picture != NULL ?
-        p_sys->p_info->current_picture->flags & PIC_FLAG_PROGRESSIVE_FRAME :
-        1;
+        p_sys->p_info->current_picture->flags & PIC_FLAG_PROGRESSIVE_FRAME : 1;
     vlc_bool_t b_top_field_first = p_sys->p_info->current_picture != NULL ?
-        p_sys->p_info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST :
-        1;
+        p_sys->p_info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST : 1;
     unsigned int i_nb_fields = p_sys->p_info->current_picture != NULL ?
         p_sys->p_info->current_picture->nb_fields : 2;
 
     /* Get a new picture */
-    while( !(p_pic = vout_CreatePicture( p_sys->p_vout,
-        b_progressive, b_top_field_first, i_nb_fields )) )
+    while( !( p_pic = vout_CreatePicture( p_sys->p_vout,
+              b_progressive, b_top_field_first, i_nb_fields ) ) )
     {
         if( p_dec->p_fifo->b_die || p_dec->p_fifo->b_error )
             break;
 
         msleep( VOUT_OUTMEM_SLEEP );
     }
-    if( p_pic == NULL )
-        return NULL;
+
+    if( p_pic == NULL ) return NULL;
+
     vout_LinkPicture( p_sys->p_vout, p_pic );
 
     pp_buf[0] = p_pic->p[0].p_pixels;
index d00e011c8466cd3d44ed136562bfc34ca30514e2..686d93e9cb83ab28bff28460e741abb2fdd7d046 100644 (file)
@@ -2,7 +2,7 @@
  * sub.c
  *****************************************************************************
  * Copyright (C) 1999-2003 VideoLAN
- * $Id: sub.c,v 1.26 2003/09/22 03:40:06 hartman Exp $
+ * $Id: sub.c,v 1.27 2003/10/08 21:03:36 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -247,10 +247,10 @@ static int  sub_open ( subtitle_demux_t *p_sub,
     p_sub->subtitle = NULL;
     p_sub->p_input = p_input;
 
-    if( !psz_name )
+    if( !psz_name || !*psz_name )
     {
-        msg_Err( p_sub, "no subtitle file specified", psz_name );
-        free( psz_name );
+        msg_Err( p_sub, "no subtitle file specified" );
+        if( psz_name ) free( psz_name );
         return VLC_EGENERIC;
     }
     
index 453d210462794759b479a6b9466ed04e6685edc5..7c5a7dd8c3c0766db790fd9f21b921184a34cc8a 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.31 2003/09/01 18:30:01 gbazin Exp $
+ * $Id: xcommon.c,v 1.32 2003/10/08 21:03:35 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -366,7 +366,7 @@ static int InitVideo( vout_thread_t *p_vout )
         case 24:
             p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
         case 32:
-            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
         default:
             msg_Err( p_vout, "unknown screen depth %i",
                      p_vout->p_sys->i_screen_depth );