On Fri, Nov 04, 2016 at 08:58:56PM +0800, Steven Liu wrote: > 2016-11-04 20:44 GMT+08:00 Michael Niedermayer <mich...@niedermayer.cc>: > > > On Fri, Nov 04, 2016 at 11:24:06AM +0800, Steven Liu wrote: > > > Add keyframe index metadata > > > Used to facilitate seeking; particularly for HTTP pseudo streaming. > > > > > > Reviewed-by: Lou Logan <l...@lrcd.com> > > > Signed-off-by: Steven Liu <li...@gosun.com> [...] > > > +static int flv_append_keyframe_info(AVFormatContext *s, FLVContext > > *flv, double ts, int64_t pos) > > > +{ > > > + FLVFileposition *position = av_malloc(sizeof(FLVFileposition)); > > > + > > > + if (!position) { > > > + av_log(s, AV_LOG_WARNING, "no mem for add keyframe index!\n"); > > > + return AVERROR(ENOMEM); > > > + } > > > + > > > + position->keyframe_timestamp = ts; > > > + position->keyframe_position = pos; > > > + > > > + if (flv->filepositions_count) { > > > + flv->filepositions = position; > > > + flv->head_filepositions = flv->filepositions; > > > + position->next = NULL; > > > + } else { > > > + flv->filepositions->next = position; > > > + position->next = NULL; > > > + flv->filepositions = flv->filepositions->next; > > > + } > > > + > > > + flv->filepositions_count++; > > > + > > > + return 0; > > > +} > > > > an array should be more space efficient than a linked list > > > array have max limit, if this is used in recording living stream to flv, > maybe linked list is better than array.
on what platform can you allocate more linked list entries (which have much more overhead) than an array ? The only i can think of are some addressing modes on 80286 but i would be very surprised if ffmpeg would run on this [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel