[FFmpeg-devel] [PATCH] nutenc: mux chapters.

Michael Niedermayer michaelni
Tue Mar 2 13:12:41 CET 2010


On Sun, Feb 28, 2010 at 10:11:55PM +0100, Anton Khirnov wrote:
[...]
> @@ -543,6 +571,16 @@ static int write_headers(NUTContext *nut, ByteIOContext *bc){
>          }
>      }
>  
> +    for (i = 0; i < nut->avf->nb_chapters; i++) {
> +        ret = url_open_dyn_buf(&dyn_bc);
> +        if (ret < 0)
> +            return ret;
> +        ret = write_chapter(nut, dyn_bc, i);
> +        if (ret < 0)
> +            return ret;

memleak ?


[...]
> @@ -583,6 +623,20 @@ static int write_header(AVFormatContext *s){
>          nut->stream[i].max_pts_distance= FFMAX(1/av_q2d(time_base), 1);
>      }
>  
> +    for (i = 0; i < s->nb_chapters; i++) {
> +        AVChapter *ch = s->chapters[i];
> +
> +        for (j = 0; j < nut->time_base_count; j++) {
> +            if (!memcmp(&ch->time_base, &nut->time_base[j], sizeof(AVRational)))
> +                break;
> +        }
> +
> +        nut->time_base[j] = ch->time_base;

> +        nut->chapter[i].time_base = &nut->time_base[j];

this is ugly
cant we simplify the code by droping ChapterContext ?

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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- 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/20100302/016c36dc/attachment.pgp>



More information about the ffmpeg-devel mailing list