> Did it look like i'm arguing for a flag in AVDictionary? That's absolutely not > what I meant. > > My idea is along the lines of having something like an 'event_flags' field in > AVFormatContext, AVStream, etc. One of the flags would be 'metadata updated'. > On > each call to the demuxer (read or seek), lavf would either clear or set this > flag to indicate whether this last call updated the metadata or not. > > (note that I'm not saying it has to be done this way, just that this solution > looks a little cleaner to me than the proposed approach. better suggestions > are > welcome)
While I'll admit that I'm not a particular fan of dictionary versioning (or a change flag, etc), it was really the only simple way I could see of accomplishing this. Having all demuxers setting flags when metadata changes would involve modifying all of them, but that just strikes me as error-prone and messy. >> As for protocol -> demuxer transport, maybe you could just clear the >> metadata in the protocol after copying it from protocol to demuxer. If >> the protocol sets the metadata again to non-empty, it means that it has >> changed. >> > > Dunno, the upper layer modifying the metadata strikes me as rather ugly. Can't > see a particularly elegant solution though. Maybe have a separate version > counter exported as an AVoption? > Will have to think about this some more. Yeah, it's not the prettiest, but I couldn't find a way around it. >> > > > As a side bonus, it will also avoid a full copy of the dict on each >> > > > update >> > > > check. >> > > >> > > Metadata is only copied when it's present, then it's cleared, so it >> > > doesn't do a copy on each update check. >> > >> > Hmm, I missed that av_metadata_updated() resets the protocol-level >> > metadata. >> > That looks rather evil to me -- judging from its name I'd certainly not >> > expect >> > it to have such side effects. >> > >> >> Oh, so much for that. > > What, did you think that it was a good idea for a function that's supposed to > check for metadata updates to also modify the metadata? > It's also rather weird/fragile that protocol-level metadata gets exported to > global _only_ when this update checking function is used. That's an excellent point. I'll incorporate that change into any future patches. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
