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

Michael Niedermayer michaelni
Fri Mar 5 16:35:02 CET 2010


On Fri, Mar 05, 2010 at 04:31:27PM +0100, Michael Niedermayer wrote:
> On Fri, Mar 05, 2010 at 02:22:54PM +0100, Anton Khirnov wrote:
> > On Tue, Mar 02, 2010 at 01:12:41PM +0100, Michael Niedermayer wrote:
> > > 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 ?
> > > 
> > fixed
> > > 
> > > [...]
> > > > @@ -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 ?
> > > 
> > well yes it is, but we need to link the chapter with the timebase
> > somehow. i don't see an obvious way to simplify this, do you?
> 
> you might not be able to get rid of the for memcmp but you maybe
> could do it per chapter, dunno

i mean when writing them ...

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20100305/10c22e1a/attachment.pgp>



More information about the ffmpeg-devel mailing list