]> git.sesse.net Git - vlc/commitdiff
* modules/demux/util/*: fixed segfault with new vobsub code.
authorGildas Bazin <gbazin@videolan.org>
Tue, 27 Jan 2004 11:57:05 +0000 (11:57 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 27 Jan 2004 11:57:05 +0000 (11:57 +0000)
modules/demux/util/sub.c
modules/demux/util/sub.h

index 8af061f2f744797a6f028395811b9439bcf0a109..4b891e9474ddbaa3e2b19a24b1180d03bb59cb59 100644 (file)
@@ -2,7 +2,7 @@
  * sub.c: subtitle demux for external subtitle files
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: sub.c,v 1.45 2004/01/27 07:05:10 hartman Exp $
+ * $Id: sub.c,v 1.46 2004/01/27 11:57:05 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Derk-Jan Hartman <hartman at videolan dot org>
@@ -97,8 +97,6 @@ static int Open ( vlc_object_t *p_this )
     p_sub->pf_seek  = sub_seek;
     p_sub->pf_close = sub_close;
     
-    ps_track_init( p_sub->tk );
-
     /* Initialize the variables */
     var_Create( p_this, "sub-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
     var_Create( p_this, "sub-delay", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
@@ -397,6 +395,7 @@ static int sub_open( subtitle_demux_t *p_sub, input_thread_t  *p_input,
             else if( local_stristr( s, "# VobSub index file" ) )
             {
                 i_sub_type = SUB_TYPE_VOBSUB;
+                ps_track_init( p_sub->tk );
                 break;
             }
         }
@@ -1184,4 +1183,3 @@ static int DemuxVobSub( subtitle_demux_t *p_demux, uint8_t *pkt, int i_pkt )
 
     return VLC_SUCCESS;
 }
-
index 73d3e6dd5ed46bc962c6aff5e8f10e3d8fe97528..d6e9ac11d1f64ca936d0f8b8534518ff092ab01b 100644 (file)
@@ -2,7 +2,7 @@
  * sub.h
  *****************************************************************************
  * Copyright (C) 2001-2004 VideoLAN
- * $Id: sub.h,v 1.17 2004/01/27 07:05:10 hartman Exp $
+ * $Id: sub.h,v 1.18 2004/01/27 11:57:05 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -67,7 +67,7 @@ typedef struct subtitle_demux_s
     es_out_id_t         *p_es;
     int                 i_previously_selected; /* to make pf_seek */
     FILE                *p_vobsub_file;
-    ps_track_t          *tk[PS_TK_COUNT];
+    ps_track_t          tk[PS_TK_COUNT];
 
 } subtitle_demux_t;