[FFmpeg-devel] [RFC] General design for subtitles demuxers
nicolas.george at normalesup.org
Wed Jun 13 20:34:23 CEST 2012
Le sextidi 26 prairial, an CCXX, Clément Bœsch a écrit :
> Thanks for the hint, that could do the trick, but unfortunately sorting
> the entries will be more complex: AVPacketList, as the name suggests, is a
> list, and not an array, so you need something more complicated than just
> using qsort() to sort the events.
> I though about adding a insert_sort flag add_to_pktbuf(), but that won't
> work because the durations must be set on the unsorted list.
> IMO it's simpler to create an array, set a simple loop to set the
> durations, and then qsort() the array.
Writing a merge sort for a linked list is very easy.
But reusing a data structure for the sake of reusing it would be silly. You
should, obviously, write the code the way you think it simpler.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel