summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-06-06 15:59:25 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-06-10 22:05:44 +0200
commitf121dbd9f76031d7f6d56261be2f14937a19d2dd (patch)
tree9a165c3d0070e70ba8e349bc93a0fab279a69ea4 /libavformat/mpegtsenc.c
parent3f7e94eccd1c0d64679f2c4eda8bb942a158dfac (diff)
mpegts: Provide an option to override the pcr period
Certain hardware demuxer have specific restrictions for PCR periodicity.
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 58a09fc60e..04cabe5f8d 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -79,6 +79,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;
@@ -559,7 +560,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);
@@ -1154,6 +1155,8 @@ static const AVOption options[] = {
// backward compatibility
{ "resend_headers", "Reemit PAT/PMT before writing the next packet",
offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 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 },
};