Reimar.Doeffinger@gmx.de (12023-07-23): > From: Reimar Döffinger > > Change some internal APIs a bit to make it harder to make > such mistakes. > In particular, have the read chunk functions return an error > when the result is incomplete. > This might be less flexible, but since there has been no > use-case for that so far, avoiding coding mistakes seems better. > Add a function to queue a AVBPrint directly (ff_subtitles_queue_insert_bprint). > Also fixes a leak in lrcdec when ff_subtitles_queue_insert fails. > --- > libavformat/assdec.c | 4 +++- > libavformat/lrcdec.c | 7 ++++++- > libavformat/mpsubdec.c | 5 +++-- > libavformat/realtextdec.c | 6 +++++- > libavformat/samidec.c | 6 +++++- > libavformat/srtdec.c | 4 +++- > libavformat/subtitles.c | 17 +++++++++++++---- > libavformat/subtitles.h | 14 ++++++++++++-- > libavformat/tedcaptionsdec.c | 2 +- > libavformat/webvttdec.c | 4 +++- > 10 files changed, 54 insertions(+), 15 deletions(-) Sorry I forgot I meant to review. These changes look for the best, except > + if (!av_bprint_is_complete(event)) return NULL; > + if (i == INT_MAX) return AVERROR_INVALIDDATA; … which do not follow the coding style. (The dynamic buffer writer of the AVWriter API makes it much harder to forget checking. But AVWriter is currently in limbo waiting for this project to reaffirm its orientation.) Regards, -- Nicolas George