diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-05 13:45:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-05 13:45:26 +0200 |
commit | 94d4f9d405074572dc7d4ab40fe32a7e83040dc8 (patch) | |
tree | dbca94224b6f24a9be81319e7b02652eb03d5cd4 /libavformat/mpegtsenc.c | |
parent | 9988899993ee6c514749244ff47d43492c42f395 (diff) | |
parent | 89616408e38ac7257e36976723df0e23d6ee1157 (diff) | |
download | ffmpeg-94d4f9d405074572dc7d4ab40fe32a7e83040dc8.tar.gz |
Merge commit '89616408e38ac7257e36976723df0e23d6ee1157'
* commit '89616408e38ac7257e36976723df0e23d6ee1157':
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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index aebf99840a..c286249149 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -95,6 +95,10 @@ typedef struct MpegTSWrite { #define DEFAULT_PES_HEADER_FREQ 16 #define DEFAULT_PES_PAYLOAD_SIZE ((DEFAULT_PES_HEADER_FREQ - 1) * 184 + 170) +/* 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) { @@ -208,7 +212,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; @@ -224,7 +228,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; @@ -475,7 +479,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; |