Commit 64680fff authored by Aman Gupta's avatar Aman Gupta

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.
Signed-off-by: 's avatarAman Gupta <aman@tmm1.net>
parent 2c2d689c
...@@ -2008,7 +2008,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type ...@@ -2008,7 +2008,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
} }
static AVStream *find_matching_stream(MpegTSContext *ts, int pid, static AVStream *find_matching_stream(MpegTSContext *ts, int pid,
int stream_id, int pmt_stream_idx) int stream_identifier, int pmt_stream_idx)
{ {
AVFormatContext *s = ts->stream; AVFormatContext *s = ts->stream;
int i; int i;
...@@ -2016,8 +2016,8 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, ...@@ -2016,8 +2016,8 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid,
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
if (stream_id != -1) { /* match based on "stream identifier descriptor" if present */ if (stream_identifier != -1) { /* match based on "stream identifier descriptor" if present */
if (st->stream_identifier == stream_id+1) { if (st->stream_identifier == stream_identifier+1) {
found = st; found = st;
break; break;
} }
...@@ -2090,7 +2090,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -2090,7 +2090,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
int program_info_length, pcr_pid, pid, stream_type; int program_info_length, pcr_pid, pid, stream_type;
int desc_list_len; int desc_list_len;
uint32_t prog_reg_desc = 0; /* registration descriptor */ uint32_t prog_reg_desc = 0; /* registration descriptor */
int stream_id = -1; int stream_identifier = -1;
int mp4_descr_count = 0; int mp4_descr_count = 0;
Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = { { 0 } }; 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 ...@@ -2180,13 +2180,13 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
goto out; goto out;
if (ts->merge_pmt_versions) if (ts->merge_pmt_versions)
stream_id = parse_stream_identifier_desc(p, p_end); stream_identifier = parse_stream_identifier_desc(p, p_end);
/* now create stream */ /* now create stream */
if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) { if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
pes = ts->pids[pid]->u.pes_filter.opaque; pes = ts->pids[pid]->u.pes_filter.opaque;
if (ts->merge_pmt_versions && !pes->st) { if (ts->merge_pmt_versions && !pes->st) {
st = find_matching_stream(ts, pid, stream_id, i); st = find_matching_stream(ts, pid, stream_identifier, i);
if (st) { if (st) {
pes->st = st; pes->st = st;
pes->stream_type = stream_type; pes->stream_type = stream_type;
...@@ -2207,7 +2207,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -2207,7 +2207,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably
pes = add_pes_stream(ts, pid, pcr_pid); pes = add_pes_stream(ts, pid, pcr_pid);
if (ts->merge_pmt_versions && pes && !pes->st) { if (ts->merge_pmt_versions && pes && !pes->st) {
st = find_matching_stream(ts, pid, stream_id, i); st = find_matching_stream(ts, pid, stream_identifier, i);
if (st) { if (st) {
pes->st = st; pes->st = st;
pes->stream_type = stream_type; pes->stream_type = stream_type;
...@@ -2228,7 +2228,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -2228,7 +2228,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
st = ts->stream->streams[idx]; st = ts->stream->streams[idx];
} }
if (ts->merge_pmt_versions && !st) { if (ts->merge_pmt_versions && !st) {
st = find_matching_stream(ts, pid, stream_id, i); st = find_matching_stream(ts, pid, stream_identifier, i);
} }
if (!st) { if (!st) {
st = avformat_new_stream(ts->stream, NULL); st = avformat_new_stream(ts->stream, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment