summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorBrad Hards <bradh@frogmouth.net>2020-10-10 17:04:30 +1100
committerMarton Balint <cus@passwd.hu>2020-10-16 23:31:45 +0200
commitfcec7a6848e79d86bb63208e5d75c6a09acd3a84 (patch)
tree7b0d61656a5296ec8a66433e2850966340cf45aa /libavformat/mpegts.c
parent15a74d21f3d7e8e6eca475903ef6252343861483 (diff)
avformat/mpegts: replace magic descriptor_tag values with defines
This takes the used values from ISO/IEC 13818-1 Table 2-45 and adds them to the mpegts.h header. No functional changes. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 432b1c3ea2..f750989629 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1804,12 +1804,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
mpegts_find_stream_type(st, desc_tag, DESC_types);
switch (desc_tag) {
- case 0x02: /* video stream descriptor */
+ case VIDEO_STREAM_DESCRIPTOR:
if (get8(pp, desc_end) & 0x1) {
st->disposition |= AV_DISPOSITION_STILL_IMAGE;
}
break;
- case 0x1E: /* SL descriptor */
+ case SL_DESCRIPTOR:
desc_es_id = get16(pp, desc_end);
if (desc_es_id < 0)
break;
@@ -1832,7 +1832,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
mpegts_open_section_filter(ts, pid, m4sl_cb, ts, 1);
}
break;
- case 0x1F: /* FMC descriptor */
+ case FMC_DESCRIPTOR:
if (get16(pp, desc_end) < 0)
break;
if (mp4_descr_count > 0 &&
@@ -1958,7 +1958,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
}
}
break;
- case 0x0a: /* ISO 639 language descriptor */
+ case ISO_639_LANGUAGE_DESCRIPTOR:
for (i = 0; i + 4 <= desc_len; i += 4) {
language[i + 0] = get8(pp, desc_end);
language[i + 1] = get8(pp, desc_end);
@@ -1984,7 +1984,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
av_dict_set(&st->metadata, "language", language, AV_DICT_DONT_OVERWRITE);
}
break;
- case 0x05: /* registration descriptor */
+ case REGISTRATION_DESCRIPTOR:
st->codecpar->codec_tag = bytestream_get_le32(pp);
av_log(fc, AV_LOG_TRACE, "reg_desc=%.4s\n", (char *)&st->codecpar->codec_tag);
if (st->codecpar->codec_id == AV_CODEC_ID_NONE || st->request_probe > 0) {
@@ -1996,7 +1996,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
case 0x52: /* stream identifier descriptor */
st->stream_identifier = 1 + get8(pp, desc_end);
break;
- case 0x26: /* metadata descriptor */
+ case METADATA_DESCRIPTOR:
if (get16(pp, desc_end) == 0xFFFF)
*pp += 4;
if (get8(pp, desc_end) == 0xFF) {
@@ -2338,13 +2338,13 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
// something else is broken, exit the program_descriptors_loop
break;
program_info_length -= len + 2;
- if (tag == 0x1d) { // IOD descriptor
+ if (tag == IOD_DESCRIPTOR) {
get8(&p, p_end); // scope
get8(&p, p_end); // label
len -= 2;
mp4_read_iods(ts->stream, p, len, mp4_descr + mp4_descr_count,
&mp4_descr_count, MAX_MP4_DESCR_COUNT);
- } else if (tag == 0x05 && len >= 4) { // registration descriptor
+ } else if (tag == REGISTRATION_DESCRIPTOR && len >= 4) {
prog_reg_desc = bytestream_get_le32(&p);
len -= 4;
}