Commit baa735b3 authored by Christophe Massiot's avatar Christophe Massiot

* modules/codec/libmpeg2.c: fixed the "main: cannot delete object with

  children" bug.
parent 4e86c7a6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmpeg2.c: mpeg2 video decoder module making use of libmpeg2. * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -259,6 +259,10 @@ static int RunDecoder( decoder_fifo_t *p_fifo ) ...@@ -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 );
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, 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) ); (u32)((u64)1001000000 * 27 / p_dec->p_info->sequence->frame_period) );
} }
...@@ -402,6 +406,9 @@ static void CloseDecoder( dec_thread_t * p_dec ) ...@@ -402,6 +406,9 @@ static void CloseDecoder( dec_thread_t * p_dec )
if( p_dec->p_pes ) if( p_dec->p_pes )
input_DeletePES( p_dec->p_fifo->p_packets_mgt, 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 ) if( p_dec->p_vout )
{ {
/* Temporary hack to free the pictures in use by libmpeg2 */ /* Temporary hack to free the pictures in use by libmpeg2 */
...@@ -419,9 +426,6 @@ static void CloseDecoder( dec_thread_t * p_dec ) ...@@ -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 ); 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 ); if( p_dec->p_mpeg2dec ) mpeg2_close( p_dec->p_mpeg2dec );
free( p_dec ); free( p_dec );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_synchro.c : frame dropping routines * vout_synchro.c : frame dropping routines
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -126,7 +126,7 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object, ...@@ -126,7 +126,7 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
msg_Err( p_object, "out of memory" ); msg_Err( p_object, "out of memory" );
return NULL; 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. */ /* We use a fake stream pattern, which is often right. */
p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P; p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
......
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