]> git.sesse.net Git - vlc/commitdiff
* modules/stream_out/transcode.c, modules/codec/ffmpeg/encoder.c: move the ffmpeg...
authorGildas Bazin <gbazin@videolan.org>
Mon, 27 Oct 2003 19:48:16 +0000 (19:48 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 27 Oct 2003 19:48:16 +0000 (19:48 +0000)
modules/codec/ffmpeg/encoder.c
modules/stream_out/transcode.c

index 9cae62ff6fa79be1ea72ff6c716b9fb96337562e..422e06b490e9aa9150bbf4dcf4eb86f4c2b85d40 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -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;
index 3a868af1fac6baa6301ce91d5fdb1aba4d70d138..ae13f152e6b767e51f2dbd31a6b6f6d6c1d02980 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -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 )