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
2008}2008}
2009 2009
2010static AVStream *find_matching_stream(MpegTSContext *ts, int pid,2010static AVStream *find_matching_stream(MpegTSContext *ts, int pid,
2011 int stream_id, int pmt_stream_idx)2011 int stream_identifier, int pmt_stream_idx)
2012{2012{
2013 AVFormatContext *s = ts->stream;2013 AVFormatContext *s = ts->stream;
2014 int i;2014 int i;
@@ -2016,8 +2016,8 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, · 1 unmodified line
2016 2016
2017 for (i = 0; i < s->nb_streams; i++) {2017 for (i = 0; i < s->nb_streams; i++) {
2018 AVStream *st = s->streams[i];2018 AVStream *st = s->streams[i];
2019 if (stream_id != -1) { /* match based on "stream identifier descriptor" if present */2019 if (stream_identifier != -1) { /* match based on "stream identifier descriptor" if present */
2020 if (st->stream_identifier == stream_id+1) {2020 if (st->stream_identifier == stream_identifier+1) {
2021 found = st;2021 found = st;
2022 break;2022 break;
2023 }2023 }
@@ -2090,7 +2090,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len · 66 unmodified lines
2090 int program_info_length, pcr_pid, pid, stream_type;2090 int program_info_length, pcr_pid, pid, stream_type;
2091 int desc_list_len;2091 int desc_list_len;
2092 uint32_t prog_reg_desc = 0; /* registration descriptor */2092 uint32_t prog_reg_desc = 0; /* registration descriptor */
2093 int stream_id = -1;2093 int stream_identifier = -1;
2094 2094
2095 int mp4_descr_count = 0;2095 int mp4_descr_count = 0;
2096 Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = { { 0 } };2096 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
2180 goto out;2180 goto out;
2181 2181
2182 if (ts->merge_pmt_versions)2182 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);
2184 2184
2185 /* now create stream */2185 /* now create stream */
2186 if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {2186 if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
2187 pes = ts->pids[pid]->u.pes_filter.opaque;2187 pes = ts->pids[pid]->u.pes_filter.opaque;
2188 if (ts->merge_pmt_versions && !pes->st) {2188 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);
2190 if (st) {2190 if (st) {
2191 pes->st = st;2191 pes->st = st;
2192 pes->stream_type = stream_type;2192 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
2207 mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably2207 mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably
2208 pes = add_pes_stream(ts, pid, pcr_pid);2208 pes = add_pes_stream(ts, pid, pcr_pid);
2209 if (ts->merge_pmt_versions && pes && !pes->st) {2209 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);
2211 if (st) {2211 if (st) {
2212 pes->st = st;2212 pes->st = st;
2213 pes->stream_type = stream_type;2213 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
2228 st = ts->stream->streams[idx];2228 st = ts->stream->streams[idx];
2229 }2229 }
2230 if (ts->merge_pmt_versions && !st) {2230 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);
2232 }2232 }
2233 if (!st) {2233 if (!st) {
2234 st = avformat_new_stream(ts->stream, NULL);2234 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