]> git.sesse.net Git - vlc/commitdiff
* modules/codec/libmpeg2.c: fixed the "main: cannot delete object with
authorChristophe Massiot <massiot@videolan.org>
Sun, 4 May 2003 22:33:35 +0000 (22:33 +0000)
committerChristophe Massiot <massiot@videolan.org>
Sun, 4 May 2003 22:33:35 +0000 (22:33 +0000)
  children" bug.

modules/codec/libmpeg2.c
src/video_output/vout_synchro.c

index 249272dab9e96cfa287ec4c23909a722b9e15b85..f96c20c8bcc5f21e3fda0d40975f641ea606f123 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.16 2003/05/04 01:36:20 massiot Exp $
+ * $Id: libmpeg2.c,v 1.17 2003/05/04 22:33:35 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -259,6 +259,10 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
             mpeg2_set_buf( p_dec->p_mpeg2dec, buf, NULL );
             mpeg2_set_buf( p_dec->p_mpeg2dec, buf, NULL );
 
+            if ( p_dec->p_synchro )
+            {
+                vout_SynchroRelease( p_dec->p_synchro );
+            }
             p_dec->p_synchro = vout_SynchroInit( p_dec->p_fifo, p_dec->p_vout,
                 (u32)((u64)1001000000 * 27 / p_dec->p_info->sequence->frame_period) );
         }
@@ -402,6 +406,9 @@ static void CloseDecoder( dec_thread_t * p_dec )
         if( p_dec->p_pes )
             input_DeletePES( p_dec->p_fifo->p_packets_mgt, p_dec->p_pes );
 
+        if( p_dec->p_synchro )
+            vout_SynchroRelease( p_dec->p_synchro );
+
         if( p_dec->p_vout )
         {
             /* Temporary hack to free the pictures in use by libmpeg2 */
@@ -419,9 +426,6 @@ static void CloseDecoder( dec_thread_t * p_dec )
             vout_Request( p_dec->p_fifo, p_dec->p_vout, 0, 0, 0, 0 );
         }
 
-        if( p_dec->p_synchro )
-            vout_SynchroRelease( p_dec->p_synchro );
-
         if( p_dec->p_mpeg2dec ) mpeg2_close( p_dec->p_mpeg2dec );
 
         free( p_dec );
index 1bab5ce8f176e02b2edbf875733dfcf242631ceb..395574f08350e953c73bb815158df3d6e3f88eb0 100644 (file)
@@ -2,7 +2,7 @@
  * vout_synchro.c : frame dropping routines
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vout_synchro.c,v 1.1 2003/04/14 22:22:32 massiot Exp $
+ * $Id: vout_synchro.c,v 1.2 2003/05/04 22:33:35 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -126,7 +126,7 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
         msg_Err( p_object, "out of memory" );
         return NULL;
     }
-    vlc_object_attach( p_synchro, p_vout );
+    vlc_object_attach( p_synchro, p_object );
 
     /* We use a fake stream pattern, which is often right. */
     p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;