[FFmpeg-devel] [RFC] General design for subtitles demuxers

Nicolas George 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.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120613/fb6ae2ba/attachment.asc>


More information about the ffmpeg-devel mailing list