[FFmpeg-devel] [PATCH]support for chapters in mkv container

Michael Niedermayer michaelni
Mon May 19 23:35:17 CEST 2008


On Mon, May 19, 2008 at 10:31:38PM +0200, Anton Khirnov wrote:
> On Sun, May 18, 2008 at 7:01 PM, Aurelien Jacobs <aurel at gnuage.org> wrote:
> >
> > I agree with this, and I'm not against a public API in general.
> > I'm just slightly against a public API which makes it slightly
> > harder to add new fields in AVChapter.
> > The easiest way to solve this now is to make this function
> > non-public. This don't prevent adding a public function later.
> > Another solution is to improve this function so that it can
> > support inserting new fields in AVChapter without API change.
> >
> 
> Ok, but I left it in avformat.h, because I don't know where else to put it.
> We could also let the caller fill all the fields for himself and then
> just pass a pointer to the chapter, but that kind of makes
> av_new_chapter useless, doesn't it?

[...]
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c	(revision 13199)
> +++ libavformat/utils.c	(working copy)
> @@ -2148,6 +2148,11 @@
>      av_freep(&s->programs);
>      flush_packet_queue(s);
>      av_freep(&s->priv_data);

> +    for(i = 0; i < s->num_chapters; i++) {
> +        av_free(s->chapters[i]->title);
> +        av_free(s->chapters[i]);
> +    }

while(s->num_chapters--){
    av_free(s->chapters[s->num_chapters]->title);
    ...


> +    av_free(s->chapters);

should be av_freep() for paranoias sake

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080519/44458158/attachment.pgp>



More information about the ffmpeg-devel mailing list