[FFmpeg-cvslog] r13242 - trunk/libavformat/matroskadec.c

Aurelien Jacobs aurel
Fri May 23 23:54:54 CEST 2008


On Fri, 23 May 2008 14:20:33 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Fri, May 23, 2008 at 02:00:12PM +0200, Aurelien Jacobs wrote:
> > Michael Niedermayer wrote:
> > 
> > > On Fri, May 23, 2008 at 01:04:02AM +0200, aurel wrote:
> > > > Author: aurel
> > > > Date: Fri May 23 01:04:02 2008
> > > > New Revision: 13242
> > > > 
> > > > Log:
> > > > matroskadec: allows inserting chapters with unspecified end
> > > > 
> > > > Modified:
> > > >    trunk/libavformat/matroskadec.c
> > > > 
> > > > Modified: trunk/libavformat/matroskadec.c
> > > > ==============================================================================
> > > > --- trunk/libavformat/matroskadec.c	(original)
> > > > +++ trunk/libavformat/matroskadec.c	Fri May 23 01:04:02 2008
> > > > @@ -2250,8 +2250,12 @@ matroska_parse_chapters(AVFormatContext 
> > > >                          }
> > > >                      }
> > > >  
> > > > -                    if(start != AV_NOPTS_VALUE && end != AV_NOPTS_VALUE)
> > > > -                        res = ff_new_chapter(s, start * AV_TIME_BASE / 1000000000 , end * AV_TIME_BASE / 1000000000, title ? title : "(unnamed)");
> > > > +                    if (start != AV_NOPTS_VALUE) {
> > > > +                        start = start * AV_TIME_BASE / 1000000000;
> > > > +                        if (end != AV_NOPTS_VALUE)
> > > > +                            end = end * AV_TIME_BASE / 1000000000;
> > > > +                        res = ff_new_chapter(s, start, end, title ? title : "(unnamed)");
> > > > +                    }
> > > >                      av_free(title);
> > > 
> > > What does a chapter with no end mean?
> > 
> > It means that the end is unknown.
> > This is not a problem for players who only allow users to seek
> > to the start of chapters. They don't use the end information.
> > Chapters can be use as a kind of track index, pointing to the
> > start of every audio tracks present in one stream.
> > Obviously, a video editor software which would allows extracting
> > one chapter out of a file couldn't use such partial chapters
> > information.
> > 
> > > Can there be more than one?
> > 
> > Sure.
> > 
> > > Does it end with the start of the next?
> > 
> > That's left to the appreciation of the software using lavf.
> > But that's should generally be a safe assumption.
> > 
> > > If so we need code to fix up these missing ends.
> > 
> > That could be nice. Still I'm not sure whether this fix up
> > should be done automatically by lavf, or if the calling
> > software have to explicitly call the fix_up function.
> 
> How am i supposed to store such chapters in nut? I mean i surely
> can store them with a duration of 0 to match the matroska stupidity
> but this does not feel correct at all.

Indeed, this is not correct. Setting the duration to infinity or
to unknown would feel better, but I guess this is not possible.

> Also there might be other containers where duration=0 chapters cannot
> be stored.

Sure.

Anyway, I get your point.
I will try to provide a patch to compute end.
But now I wonder how to handle last chapter (when it has no end).
I think it's still useful to be able to declare it as
"infinite" length.

Aurel




More information about the ffmpeg-cvslog mailing list