aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-30 20:09:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-30 20:20:01 +0200
commita507fea70769533d2f666bcc63edc8d15b6784be (patch)
treed306cd4320708e6a626fc882ffe8065b7a2f368c /libavformat/mpegtsenc.c
parent41e859151543a25652b217f637ac62f55f7b256e (diff)
parent694b7cd873f8b06af109036eff1ccd741afdd28e (diff)
downloadffmpeg-a507fea70769533d2f666bcc63edc8d15b6784be.tar.gz
Merge commit '694b7cd873f8b06af109036eff1ccd741afdd28e' into release/1.1
* commit '694b7cd873f8b06af109036eff1ccd741afdd28e': mpegts: Define the section length with a constant Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index d09e4a012a..a4cc752d59 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -130,6 +130,10 @@ static const AVClass mpegts_muxer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
+/* The section length is 12 bits. The first 2 are set to 0, the remaining
+ * 10 bits should not exceed 1021. */
+#define SECTION_LENGTH 1020
+
/* NOTE: 4 bytes must be left at the end for the crc32 */
static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
{
@@ -242,7 +246,7 @@ static void mpegts_write_pat(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSService *service;
- uint8_t data[1012], *q;
+ uint8_t data[SECTION_LENGTH], *q;
int i;
q = data;
@@ -258,7 +262,7 @@ static void mpegts_write_pat(AVFormatContext *s)
static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
{
MpegTSWrite *ts = s->priv_data;
- uint8_t data[1012], *q, *desc_length_ptr, *program_info_length_ptr;
+ uint8_t data[SECTION_LENGTH], *q, *desc_length_ptr, *program_info_length_ptr;
int val, stream_type, i;
q = data;
@@ -429,7 +433,7 @@ static void mpegts_write_sdt(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSService *service;
- uint8_t data[1012], *q, *desc_list_len_ptr, *desc_len_ptr;
+ uint8_t data[SECTION_LENGTH], *q, *desc_list_len_ptr, *desc_len_ptr;
int i, running_status, free_ca_mode, val;
q = data;