Revision cdf38a17 ffmpeg.c

View differences:

ffmpeg.c
1364 1364
                    } else {
1365 1365
                        AVFrame avframe; //FIXME/XXX remove this
1366 1366
                        AVPacket opkt;
1367
                        int64_t ost_tb_start_time= av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base);
1368

  
1367 1369
                        av_init_packet(&opkt);
1368 1370

  
1369 1371
                        if ((!ost->frame_number && !(pkt->flags & PKT_FLAG_KEY)) && !copy_initial_nonkeyframes)
......
1385 1387

  
1386 1388
                        opkt.stream_index= ost->index;
1387 1389
                        if(pkt->pts != AV_NOPTS_VALUE)
1388
                            opkt.pts= av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base);
1390
                            opkt.pts= av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time;
1389 1391
                        else
1390 1392
                            opkt.pts= AV_NOPTS_VALUE;
1391 1393

  
......
1393 1395
                            opkt.dts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->st->time_base);
1394 1396
                        else
1395 1397
                            opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base);
1398
                        opkt.dts -= ost_tb_start_time;
1396 1399

  
1397 1400
                        opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
1398 1401
                        opkt.flags= pkt->flags;

Also available in: Unified diff