[FFmpeg-devel] [PATCH] nutenc: mux chapters.
Anton Khirnov
wyskas
Fri Mar 5 14:22:54 CET 2010
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?
Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-nutenc-mux-chapters.patch
Type: text/x-diff
Size: 5036 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100305/73b1e8da/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100305/73b1e8da/attachment.pgp>
More information about the ffmpeg-devel
mailing list