summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-10 23:43:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-10 23:55:57 +0200
commitaff0912da551ed93e8e37ae3e4f2d18cc79cdb36 (patch)
tree4e2b736dae1acc0cbb91aedbf6073a41af56e180 /libavformat
parent723adfb1df13fae0d0f675af69958993cafd18dd (diff)
parentf121dbd9f76031d7f6d56261be2f14937a19d2dd (diff)
Merge commit 'f121dbd9f76031d7f6d56261be2f14937a19d2dd'
* commit 'f121dbd9f76031d7f6d56261be2f14937a19d2dd': mpegts: Provide an option to override the pcr period Conflicts: doc/muxers.texi libavformat/mpegtsenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegtsenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index a8967b27c1..f0d9cd2780 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -81,6 +81,7 @@ typedef struct MpegTSWrite {
int reemit_pat_pmt; // backward compatibility
+ int pcr_period;
#define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01
#define MPEGTS_FLAG_AAC_LATM 0x02
int flags;
@@ -685,7 +686,7 @@ static int mpegts_write_header(AVFormatContext *s)
}
if (ts->mux_rate > 1) {
- service->pcr_packet_period = (ts->mux_rate * PCR_RETRANS_TIME) /
+ 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);
@@ -1380,6 +1381,8 @@ static const AVOption options[] = {
offsetof(MpegTSWrite, tables_version), AV_OPT_TYPE_INT, {.i64=0}, 0, 31, AV_OPT_FLAG_ENCODING_PARAM},
{ "omit_video_pes_length", "Omit the PES packet length for video packets",
offsetof(MpegTSWrite, omit_video_pes_length), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
+ { "pcr_period", "PCR retransmission time",
+ offsetof(MpegTSWrite, pcr_period), AV_OPT_TYPE_INT, { .i64 = PCR_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
};