On Thu, 17 May 2018 18:13:34 -0700 Aman Gupta <a...@tmm1.net> wrote: > On Thu, May 17, 2018 at 3:49 PM, Aman Gupta <ffm...@tmm1.net> wrote: > > > From: Aman Gupta <a...@tmm1.net> > > > > This can be used to detect changes to the streams in an AVProgram > > > > Forgot to add: I have seen two related patches in the wild that attempt to > solve this same problem in different ways. > > The first is in MythTV's ffmpeg fork, where they added a void > (*streams_changed)(void*); to AVFormatContext and call it from their mpegts > demuxer when the PMT changes. > > The second was proposed by XBMC in > https://ffmpeg.org/pipermail/ffmpeg-devel/2012-December/135036.html, where > they created a new AVMEDIA_TYPE_DATA stream with id=0 and attempted to send > packets to it whenever the PMT changed. > > The approach in this patch is similar to what's used by > AVFormatContext.event_flags and AVFMT_EVENT_FLAG_METADATA_UPDATED. > > I re-used AVProgram.flags for this purpose (which appears not to be used > for anything else). To be more explicit, it might be better to add > AVProgram.event_flags. Note that either way, the user would need to clear > AV_PROGRAM_CHANGED after detecting it (which should be documented). > > Another possibility would be to remove AV_PROGRAM_CHANGED altogether, which > means the user would need to keep a copy of program->version and compare it > to detect changes.
Probably needs new doxygen that says that the API user can clear that change flag when convenient. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel