On Fri, 13 Nov 2015, Nicolas George wrote:
[...]
+ AVDictionary *metadata = av_frame_get_metadata(frame);
+ AVDictionaryEntry *e1 = av_dict_get(metadata, "lavf.concatdec.start_time",
NULL, 0);
+ AVDictionaryEntry *e2 = av_dict_get(metadata, "lavf.concatdec.duration",
NULL, 0);
+ if (e1 && e1->value) {
Is the "e1->value" test necessary?
Probably not, as far as I see av_dict_get cannot return a dictionary entry
with entry->value set to NULL.
+ int64_t start_time = strtoll(e1->value, NULL, 10);
+ if (pts >= start_time) {
+ if (e2 && e2->value) {
+ int64_t duration = strtoll(e2->value, NULL, 10);
+ if (pts < start_time + duration)
+ return -1;
+ else
+ return 0;
+ }
+ return -1;
Did you mean +1 here?
No, this is deliberately -1. This is the case where the duration metadata
is missing (because it is unkown), but this also means that the outpoint
was not set in the file segment, therefore we need to select every frame
after start_time until the segment ends.
LGTM apart from that, but I do not maintain this filter.
I'll ping Stefano who is the original author just to be sure.
Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel