summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-14 01:53:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-14 01:53:31 +0100
commit04b53746ad296b9167002ec5d16a9cfb9de7985b (patch)
tree091021a7ecae7fe76b9d180c2fa1a2d4a4c66ef4 /libavformat/mpegtsenc.c
parent387783749faca39c98571d139c32866923ab5653 (diff)
parent7dfe8f55575a3ae0fdd6f0678fa9627122580b07 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtpdec: Use 4 byte startcodes for H.264 matroskadec: Mark variable as av_unused. Move some conditionally used variables into the block where they are used. Drop some completely unnecessary av_unused attributes. swscale: Remove unused variable alpMmxFilter. Drop unnecessary av_uninit attributes from some variable declarations. movenc: Support muxing wmapro in ismv/isma mpegtsenc: Add an AVOption for forcing a new PAT/PMT/SDT to be written swscale: move YUV2PACKED16WRAPPER() macro down to where it is used. swscale: handle gray16 as a "planar" YUV format (Y-only, of course). swscale: use yuv2packed1() functions for unscaled chroma also. swscale: fix incorrect chroma bias in yuv2rgb48_1_c(). swscale: fix invalid memory accesses in yuvpacked1() functions. Move PS2 MMI code below the mips subdirectory, where it belongs. mips: Move MMI function declarations to a header. build: Set correct dependencies for rtmp* protocols implemented by librtmp. Conflicts: libavcodec/ac3enc_template.c libavformat/mpegtsenc.c libswscale/output.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 4b303def4b..b0047a216e 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -78,6 +78,8 @@ typedef struct MpegTSWrite {
int pmt_start_pid;
int start_pid;
int m2ts_mode;
+
+ int reemit_pat_pmt;
} MpegTSWrite;
/* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */
@@ -101,6 +103,8 @@ static const AVOption options[] = {
{ "muxrate", NULL, offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT, {1}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
{ "pes_payload_size", "Minimum PES packet payload in bytes",
offsetof(MpegTSWrite, pes_payload_size), AV_OPT_TYPE_INT, {DEFAULT_PES_PAYLOAD_SIZE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
+ { "resend_headers", "Reemit PAT/PMT before writing the next packet",
+ offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};
@@ -978,6 +982,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
const uint64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE)*2;
int64_t dts = AV_NOPTS_VALUE, pts = AV_NOPTS_VALUE;
+ if (ts->reemit_pat_pmt) {
+ ts->pat_packet_count = ts->pat_packet_period - 1;
+ ts->sdt_packet_count = ts->sdt_packet_period - 1;
+ ts->reemit_pat_pmt = 0;
+ }
+
if (pkt->pts != AV_NOPTS_VALUE)
pts = pkt->pts + delay;
if (pkt->dts != AV_NOPTS_VALUE)