diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c old mode 100644 new mode 100755 index 3a5ed69..5c533cc --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1509,7 +1509,11 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (!st) goto out; - +#if CONFIG_AV_PID_NUMBER_PASSTHRU + // note down the pid numbers inorder to pass-thru to the muxer + ts->pids_num[st->index] = pid; + ts->total_streams++; +#endif if (pes && !pes->stream_type) mpegts_set_stream_info(st, pes, stream_type, prog_reg_desc); @@ -1949,6 +1953,12 @@ static int mpegts_read_header(AVFormatContext *s) mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1); handle_packets(ts, s->probesize / ts->raw_packet_size); +#if CONFIG_AV_PID_NUMBER_PASSTHRU + // transfer pid numbers from TS format to input format context + s->total_streams = ts->total_streams; + for(int i=0;itotal_streams; i++) + s->pids_num[i] = ts->pids_num[i]; +#endif /* if could not find service, enable auto_guess */ ts->auto_guess = 1;