History

avformat/mpegts: rename variable to clarify meaning

Both stream_id and stream_identifier are used in this file, and have different meanings. The latter comes from the stream_identifier_descriptor.

Aman Gupta committed 8 years ago

Commit 64680ff1 parent 2c2d6891 file · +8 −8Browse files

Unified · Split

libavformat/mpegts.c+8−8
@@ -2008,7 +2008,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type · 2007 unmodified lines
20082008 }
20092009
20102010 static AVStream *find_matching_stream(MpegTSContext *ts, int pid,
2011− int stream_id, int pmt_stream_idx)
2011+ int stream_identifier, int pmt_stream_idx)
20122012 {
20132013 AVFormatContext *s = ts->stream;
20142014 int i;
@@ -2016,8 +2016,8 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, · 1 unmodified line
20162016
20172017 for (i = 0; i < s->nb_streams; i++) {
20182018 AVStream *st = s->streams[i];
2019− if (stream_id != -1) { /* match based on "stream identifier descriptor" if present */
2020− if (st->stream_identifier == stream_id+1) {
2019+ if (stream_identifier != -1) { /* match based on "stream identifier descriptor" if present */
2020+ if (st->stream_identifier == stream_identifier+1) {
20212021 found = st;
20222022 break;
20232023 }
@@ -2090,7 +2090,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len · 66 unmodified lines
20902090 int program_info_length, pcr_pid, pid, stream_type;
20912091 int desc_list_len;
20922092 uint32_t prog_reg_desc = 0; /* registration descriptor */
2093− int stream_id = -1;
2093+ int stream_identifier = -1;
20942094
20952095 int mp4_descr_count = 0;
20962096 Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = { { 0 } };
@@ -2180,13 +2180,13 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len · 83 unmodified lines
21802180 goto out;
21812181
21822182 if (ts->merge_pmt_versions)
2183− stream_id = parse_stream_identifier_desc(p, p_end);
2183+ stream_identifier = parse_stream_identifier_desc(p, p_end);
21842184
21852185 /* now create stream */
21862186 if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
21872187 pes = ts->pids[pid]->u.pes_filter.opaque;
21882188 if (ts->merge_pmt_versions && !pes->st) {
2189− st = find_matching_stream(ts, pid, stream_id, i);
2189+ st = find_matching_stream(ts, pid, stream_identifier, i);
21902190 if (st) {
21912191 pes->st = st;
21922192 pes->stream_type = stream_type;
@@ -2207,7 +2207,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len · 14 unmodified lines
22072207 mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably
22082208 pes = add_pes_stream(ts, pid, pcr_pid);
22092209 if (ts->merge_pmt_versions && pes && !pes->st) {
2210− st = find_matching_stream(ts, pid, stream_id, i);
2210+ st = find_matching_stream(ts, pid, stream_identifier, i);
22112211 if (st) {
22122212 pes->st = st;
22132213 pes->stream_type = stream_type;
@@ -2228,7 +2228,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len · 14 unmodified lines
22282228 st = ts->stream->streams[idx];
22292229 }
22302230 if (ts->merge_pmt_versions && !st) {
2231− st = find_matching_stream(ts, pid, stream_id, i);
2231+ st = find_matching_stream(ts, pid, stream_identifier, i);
22322232 }
22332233 if (!st) {
22342234 st = avformat_new_stream(ts->stream, NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t