* transcode.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.38 2003/10/09 11:48:41 gbazin Exp $
+ * $Id: transcode.c,v 1.43 2003/10/24 21:27:06 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 = in->i_dts;
+ p_out->i_pts = in->i_dts;
sout_BufferChain( out, p_out );
}
}
/* convert size and crop */
- if( !id->p_encoder )
if( id->ff_dec_c->width != id->f_dst.i_width ||
id->ff_dec_c->height != id->f_dst.i_height ||
p_sys->i_crop_top > 0 || p_sys->i_crop_bottom > 0 ||
}
/* 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;
int i_plane;
vout_InitPicture( VLC_OBJECT(p_stream), &pic,
+ id->p_encoder->format.video.i_chroma,
id->f_dst.i_width, id->f_dst.i_height,
- id->p_encoder->format.video.i_chroma );
+ id->f_dst.i_width * VOUT_ASPECT_FACTOR /
+ id->f_dst.i_height );
for( i_plane = 0; i_plane < pic.i_planes; i_plane++ )
{
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 );
}