Merge commit '694b7cd873f8b06af109036eff1ccd741afdd28e' into release/1.1
* commit '694b7cd873f8b06af109036eff1ccd741afdd28e': mpegts: Define the section length with a constant Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -130,6 +130,10 @@ static const AVClass mpegts_muxer_class = {
|
|||||||
.version = LIBAVUTIL_VERSION_INT,
|
.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 */
|
/* NOTE: 4 bytes must be left at the end for the crc32 */
|
||||||
static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
|
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;
|
MpegTSWrite *ts = s->priv_data;
|
||||||
MpegTSService *service;
|
MpegTSService *service;
|
||||||
uint8_t data[1012], *q;
|
uint8_t data[SECTION_LENGTH], *q;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
q = data;
|
q = data;
|
||||||
@@ -258,7 +262,7 @@ static void mpegts_write_pat(AVFormatContext *s)
|
|||||||
static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
|
static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
|
||||||
{
|
{
|
||||||
MpegTSWrite *ts = s->priv_data;
|
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;
|
int val, stream_type, i;
|
||||||
|
|
||||||
q = data;
|
q = data;
|
||||||
@@ -429,7 +433,7 @@ static void mpegts_write_sdt(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
MpegTSWrite *ts = s->priv_data;
|
MpegTSWrite *ts = s->priv_data;
|
||||||
MpegTSService *service;
|
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;
|
int i, running_status, free_ca_mode, val;
|
||||||
|
|
||||||
q = data;
|
q = data;
|
||||||
|
Reference in New Issue
Block a user