diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 7a924db..180fa42 100644
|
a
|
b
|
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
|
| 91 | 91 | pkt->pts = pkt->dts; |
| 92 | 92 | |
| 93 | 93 | pkt->duration = av_rescale_q(pkt->duration, pkt->time_base, ost->st->time_base); |
| | 94 | } else if (ost->type == AVMEDIA_TYPE_SUBTITLE && ost->par_in->codec_id == AV_CODEC_ID_ASS) { |
| | 95 | av_packet_rescale_ts_end(pkt, pkt->time_base, ost->st->time_base); |
| 94 | 96 | } else |
| 95 | 97 | av_packet_rescale_ts(pkt, pkt->time_base, ost->st->time_base); |
| 96 | 98 | pkt->time_base = ost->st->time_base; |
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index e29725c..3926590 100644
|
a
|
b
|
int av_packet_make_writable(AVPacket *pkt)
|
| 524 | 524 | return 0; |
| 525 | 525 | } |
| 526 | 526 | |
| | 527 | void av_packet_rescale_ts_end(AVPacket *pkt, AVRational src_tb, AVRational dst_tb) |
| | 528 | { |
| | 529 | int64_t old_pts = pkt->pts; |
| | 530 | pkt->pts = av_rescale_q(pkt->pts, src_tb, dst_tb); |
| | 531 | if (pkt->dts != AV_NOPTS_VALUE) |
| | 532 | pkt->dts = av_rescale_q(pkt->dts, src_tb, dst_tb); |
| | 533 | pkt->duration = av_rescale_q(pkt->duration + old_pts, src_tb, dst_tb) - pkt->pts; |
| | 534 | } |
| | 535 | |
| 527 | 536 | void av_packet_rescale_ts(AVPacket *pkt, AVRational src_tb, AVRational dst_tb) |
| 528 | 537 | { |
| 529 | 538 | if (pkt->pts != AV_NOPTS_VALUE) |
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index b19409b..49be5cd 100644
|
a
|
b
|
int av_packet_make_writable(AVPacket *pkt);
|
| 839 | 839 | */ |
| 840 | 840 | void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst); |
| 841 | 841 | |
| | 842 | void av_packet_rescale_ts_end(AVPacket *pkt, AVRational tb_src, AVRational tb_dst); |
| | 843 | |
| 842 | 844 | /** |
| 843 | 845 | * @} |
| 844 | 846 | */ |