From: Gildas Bazin Date: Mon, 27 Oct 2003 19:48:16 +0000 (+0000) Subject: * modules/stream_out/transcode.c, modules/codec/ffmpeg/encoder.c: move the ffmpeg... X-Git-Tag: 0.7.0~698 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f6dca10f5937cbbf5b2924e0357c555875a94027;p=vlc * modules/stream_out/transcode.c, modules/codec/ffmpeg/encoder.c: move the ffmpeg pts hack to the ffmpeg encoder. --- diff --git a/modules/codec/ffmpeg/encoder.c b/modules/codec/ffmpeg/encoder.c index 9cae62ff6f..422e06b490 100644 --- a/modules/codec/ffmpeg/encoder.c +++ b/modules/codec/ffmpeg/encoder.c @@ -2,7 +2,7 @@ * encoder.c: video and audio encoder using the ffmpeg library ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: encoder.c,v 1.2 2003/10/27 17:50:54 gbazin Exp $ + * $Id: encoder.c,v 1.3 2003/10/27 19:48:16 gbazin Exp $ * * Authors: Laurent Aimar * Gildas Bazin @@ -224,7 +224,11 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) frame.linesize[i_plane] = p_pict->p[i_plane].i_pitch; } - frame.pts = p_pict->date; + /* Set the pts of the frame being encoded (segfaults with mpeg4!)*/ + if( p_enc->i_fourcc == VLC_FOURCC( 'm', 'p', 'g', 'v' ) ) + frame.pts = p_pict->date; + else + frame.pts = 0; /* Let ffmpeg select the frame type */ frame.pict_type = 0; diff --git a/modules/stream_out/transcode.c b/modules/stream_out/transcode.c index 3a868af1fa..ae13f152e6 100644 --- a/modules/stream_out/transcode.c +++ b/modules/stream_out/transcode.c @@ -2,7 +2,7 @@ * transcode.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: transcode.c,v 1.45 2003/10/27 17:50:54 gbazin Exp $ + * $Id: transcode.c,v 1.46 2003/10/27 19:48:16 gbazin Exp $ * * Authors: Laurent Aimar * Gildas Bazin @@ -729,7 +729,7 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, (int16_t*)id->p_buffer, &id->i_buffer_pos, p_buffer, i_buffer ); -#if 1 +#if 0 msg_Warn( p_stream, "avcodec_decode_audio: %d used on %d", i_used, i_buffer ); #endif @@ -1274,13 +1274,6 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream, frame = id->p_ff_pic_tmp2; } - /* Set the pts of the frame being encoded (segfaults with mpeg4!)*/ - 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; - /* Interpolate the next PTS * (needed by the mpeg video packetizer which can send pts <= 0 ) */ if( id->ff_dec_c && id->ff_dec_c->frame_rate > 0 )