* transcode.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.39 2003/10/09 12:31:05 gbazin Exp $
+ * $Id: transcode.c,v 1.41 2003/10/09 19:31:38 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_out->i_size = header[i].bytes;
p_out->i_length = 0;
- p_out->i_dts = p_out->i_pts = 0;
+ p_out->i_dts = p_out->i_pts = id->i_dts;
sout_BufferChain( out, p_out );
}
/* find encoder */
- id->ff_enc = NULL;
+ id->ff_enc = id->ff_enc_c = NULL;
i_ff_codec = get_ff_codec( id->f_dst.i_fourcc );
if( i_ff_codec != 0 )
{
}
free( id->ff_dec_c );
- free( id->ff_enc_c );
+ if( id->ff_enc_c ) free( id->ff_enc_c );
free( id->p_buffer );
}
sout_buffer_t *p_out;
p_out = sout_BufferNew( p_stream->p_sout, p_block->i_buffer );
memcpy( p_out->p_buffer, p_block->p_buffer, p_block->i_buffer);
+ p_out->i_dts = id->i_dts;
+ p_out->i_pts = id->i_dts;
sout_BufferChain( out, p_out );
}
}
/* Set the pts of the frame being encoded (segfaults with mpeg4!)*/
- if( id->f_dst.i_fourcc == VLC_FOURCC( 'm', 'p', 'g', 'v' ) )
+ if( id->p_encoder ||
+ id->f_dst.i_fourcc == VLC_FOURCC( 'm', 'p', 'g', 'v' ) )
frame->pts = p_sys->i_output_pts;
else
frame->pts = 0;
sout_buffer_t *p_out;
p_out = sout_BufferNew( p_stream->p_sout, p_block->i_buffer );
memcpy( p_out->p_buffer, p_block->p_buffer, p_block->i_buffer);
+ p_out->i_dts = p_block->i_dts;
+ p_out->i_pts = p_block->i_pts;
sout_BufferChain( out, p_out );
block_Release( p_block );
}