diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-12 19:01:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-12 19:01:28 +0200 |
commit | da19bfb2876d63829146bb2103c03e867b86a4ef (patch) | |
tree | 01768ab662e7fe29adf1012e6da68150b0661d69 /libavformat | |
parent | a94fe0e15148435a32ecde30b984de79751bd094 (diff) | |
parent | d86df7dd497ead1132bd95df7c4c18d91fbe3def (diff) | |
download | ffmpeg-da19bfb2876d63829146bb2103c03e867b86a4ef.tar.gz |
Merge commit 'd86df7dd497ead1132bd95df7c4c18d91fbe3def' into release/0.10
* commit 'd86df7dd497ead1132bd95df7c4c18d91fbe3def':
mpegts: Define the section length with a constant
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegtsenc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 84cdcbde40..6a70bf0b62 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -111,6 +111,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) { @@ -222,7 +226,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; @@ -237,8 +241,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; @@ -401,7 +404,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; |