[FFmpeg-cvslog] r18382 - trunk/ffmpeg.c

michael subversion
Thu Apr 9 02:14:00 CEST 2009


Author: michael
Date: Thu Apr  9 02:13:59 2009
New Revision: 18382

Log:
Fix -ss / -t interaction with -acodec copy.
Fixes issue203

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Wed Apr  8 22:48:44 2009	(r18381)
+++ trunk/ffmpeg.c	Thu Apr  9 02:13:59 2009	(r18382)
@@ -1364,6 +1364,8 @@ static int output_packet(AVInputStream *
                     } else {
                         AVFrame avframe; //FIXME/XXX remove this
                         AVPacket opkt;
+                        int64_t ost_tb_start_time= av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base);
+
                         av_init_packet(&opkt);
 
                         if ((!ost->frame_number && !(pkt->flags & PKT_FLAG_KEY)) && !copy_initial_nonkeyframes)
@@ -1385,7 +1387,7 @@ static int output_packet(AVInputStream *
 
                         opkt.stream_index= ost->index;
                         if(pkt->pts != AV_NOPTS_VALUE)
-                            opkt.pts= av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base);
+                            opkt.pts= av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time;
                         else
                             opkt.pts= AV_NOPTS_VALUE;
 
@@ -1393,6 +1395,7 @@ static int output_packet(AVInputStream *
                             opkt.dts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->st->time_base);
                         else
                             opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base);
+                        opkt.dts -= ost_tb_start_time;
 
                         opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
                         opkt.flags= pkt->flags;



More information about the ffmpeg-cvslog mailing list