Commit 02d6bac4 authored by Gildas Bazin's avatar Gildas Bazin

* modules/packetizer/mpegvideo.c: fixed major bug where the first frame could be sent out with a null dts.
* src/stream_output/stream_output.c: guard against non-dated packets in sout_InputSendBuffer().
parent a3aa9847
......@@ -2,7 +2,7 @@
* mpegvideo.c: parse and packetize an MPEG1/2 video stream
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpegvideo.c,v 1.27 2004/01/25 17:58:30 murray Exp $
* $Id: mpegvideo.c,v 1.28 2004/01/27 14:05:33 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -294,6 +294,10 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
break;
}
/* When starting the stream we can have the first frame with
* a null DTS (i_interpolated_pts is initialized to 0) */
if( !p_pic->i_dts ) p_pic->i_dts = p_pic->i_pts;
/* So p_block doesn't get re-added several times */
*pp_block = block_BytestreamPop( &p_sys->bytestream );
......
......@@ -2,7 +2,7 @@
* stream_output.c : stream output module
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id: stream_output.c,v 1.38 2004/01/23 17:56:14 gbazin Exp $
* $Id: stream_output.c,v 1.39 2004/01/27 14:05:33 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -237,7 +237,6 @@ int sout_InputDelete( sout_packetizer_input_t *p_input )
return( VLC_SUCCESS);
}
int sout_InputSendBuffer( sout_packetizer_input_t *p_input,
sout_buffer_t *p_buffer )
{
......@@ -250,8 +249,16 @@ int sout_InputSendBuffer( sout_packetizer_input_t *p_input,
return VLC_SUCCESS;
}
if( !p_buffer->i_dts )
{
msg_Warn( p_sout, "trying to send non-dated packet to stream output!");
sout_BufferDelete( p_input->p_sout, p_buffer );
return VLC_SUCCESS;
}
vlc_mutex_lock( &p_sout->lock );
i_ret = p_sout->p_stream->pf_send( p_sout->p_stream, p_input->id, p_buffer );
i_ret = p_sout->p_stream->pf_send( p_sout->p_stream,
p_input->id, p_buffer );
vlc_mutex_unlock( &p_sout->lock );
return i_ret;
......
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