avformat/mpegts: keep track of PMT details in AVProgram/AVStream
authorAman Gupta <aman@tmm1.net>
Thu, 17 May 2018 22:31:11 +0000 (15:31 -0700)
committerAman Gupta <aman@tmm1.net>
Sat, 19 May 2018 02:00:29 +0000 (19:00 -0700)
commit24579bf53747176bc288fdcca98d1f3209099ade
tree9a3b12d2d8e6790cb09130085f9c4aa5bce05b3b
parent2b2f2f65f38cdd64fe126079f84872c0b06c6afc
avformat/mpegts: keep track of PMT details in AVProgram/AVStream

With these fields, the user has enough information to
detect PMT changes and switch to new streams when the PMT
is updated with new ES pids.

To do so, the user would monitor the AVProgram they're interested
in for changes to pmt_version. If the version changes, they would
iterate over the program's streams to find new streams added with
the updated version number.

If new versions of streams are found, then the user would first try
to replace existing streams where stream_identifier matched.
If stream_identifier is not available, then the user would compare
pmt_stream_idx instead to replace the stream that was previously
at the same position within the PMT.

Signed-off-by: Aman Gupta <aman@tmm1.net>
libavformat/mpegts.c