summaryrefslogtreecommitdiff
path: root/main/ffmpeg/fix-mpegtsenc-cbr-scaling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/ffmpeg/fix-mpegtsenc-cbr-scaling.patch')
-rw-r--r--main/ffmpeg/fix-mpegtsenc-cbr-scaling.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/main/ffmpeg/fix-mpegtsenc-cbr-scaling.patch b/main/ffmpeg/fix-mpegtsenc-cbr-scaling.patch
new file mode 100644
index 00000000000..25f85cb378a
--- /dev/null
+++ b/main/ffmpeg/fix-mpegtsenc-cbr-scaling.patch
@@ -0,0 +1,20 @@
+diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
+index 468bad4..8c0987c 100644
+--- a/libavformat/mpegtsenc.c
++++ b/libavformat/mpegtsenc.c
+@@ -852,12 +852,9 @@ static int mpegts_write_header(AVFormatContext *s)
+ ts_st = pcr_st->priv_data;
+
+ if (ts->mux_rate > 1) {
+- service->pcr_packet_period = (ts->mux_rate * ts->pcr_period) /
+- (TS_PACKET_SIZE * 8 * 1000);
+- ts->sdt_packet_period = (ts->mux_rate * SDT_RETRANS_TIME) /
+- (TS_PACKET_SIZE * 8 * 1000);
+- ts->pat_packet_period = (ts->mux_rate * PAT_RETRANS_TIME) /
+- (TS_PACKET_SIZE * 8 * 1000);
++ service->pcr_packet_period = av_rescale(ts->pcr_period, ts->mux_rate, TS_PACKET_SIZE * 8 * 1000);
++ ts->sdt_packet_period = av_rescale(SDT_RETRANS_TIME, ts->mux_rate, TS_PACKET_SIZE * 8 * 1000);
++ ts->pat_packet_period = av_rescale(PAT_RETRANS_TIME, ts->mux_rate, TS_PACKET_SIZE * 8 * 1000);
+
+ if (ts->copyts < 1)
+ ts->first_pcr = av_rescale(s->max_delay, PCR_TIME_BASE, AV_TIME_BASE);