Commit c22f698a authored by michael's avatar michael

Fix -ss / -t interaction with -acodec copy.

Fixes issue203


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18382 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 03463020
...@@ -1364,6 +1364,8 @@ static int output_packet(AVInputStream *ist, int ist_index, ...@@ -1364,6 +1364,8 @@ static int output_packet(AVInputStream *ist, int ist_index,
} else { } else {
AVFrame avframe; //FIXME/XXX remove this AVFrame avframe; //FIXME/XXX remove this
AVPacket opkt; 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); av_init_packet(&opkt);
if ((!ost->frame_number && !(pkt->flags & PKT_FLAG_KEY)) && !copy_initial_nonkeyframes) if ((!ost->frame_number && !(pkt->flags & PKT_FLAG_KEY)) && !copy_initial_nonkeyframes)
...@@ -1385,7 +1387,7 @@ static int output_packet(AVInputStream *ist, int ist_index, ...@@ -1385,7 +1387,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
opkt.stream_index= ost->index; opkt.stream_index= ost->index;
if(pkt->pts != AV_NOPTS_VALUE) 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 else
opkt.pts= AV_NOPTS_VALUE; opkt.pts= AV_NOPTS_VALUE;
...@@ -1393,6 +1395,7 @@ static int output_packet(AVInputStream *ist, int ist_index, ...@@ -1393,6 +1395,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
opkt.dts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->st->time_base); opkt.dts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->st->time_base);
else else
opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base); 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.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
opkt.flags= pkt->flags; opkt.flags= pkt->flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment