[FFmpeg-devel] [PATCH 1/2] lavf: make max_analyze_duration warning an information log.

Michael Niedermayer michaelni at gmx.at
Fri Jan 27 22:31:26 CET 2012


On Fri, Jan 27, 2012 at 09:53:24PM +0100, Clément Bœsch wrote:
> On Thu, Jan 26, 2012 at 03:15:59PM +0100, Michael Niedermayer wrote:
> > On Thu, Jan 26, 2012 at 01:53:43PM +0100, Clément Bœsch wrote:
> > > This avoids the confusion of having a warning almost everytime we are
> > > probing a mp3. It may suppose the file is not muxed correctly while it
> > > is actually a normal behaviour.
> > 
> > why is the code not exiting earlier ?
> > what information is missing for that ?
> > 
> > It would be better to return earlier because it reduces startup
> > latency
> > 
> 
> It seems to trigger the st->first_dts == AV_NOPTS_VALUE check. After a
> talk with Hendrik on IRC, a potential solution would have be to do
> something like:
> 
> diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
> index b5ed83e..96daf5c 100644
> --- a/libavformat/mp3dec.c
> +++ b/libavformat/mp3dec.c
> @@ -197,6 +197,6 @@ AVInputFormat ff_mp3_demuxer = {
>      .read_probe     = mp3_read_probe,
>      .read_header    = mp3_read_header,
>      .read_packet    = mp3_read_packet,
> -    .flags= AVFMT_GENERIC_INDEX,
> +    .flags          = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS,
>      .extensions = "mp2,mp3,m2a", /* XXX: use probe */
>  };
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index c1de71d..090fdff 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2474,8 +2474,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
>                  break;
>              if(st->parser && st->parser->parser->split && !st->codec->extradata)
>                  break;
> -            if(st->first_dts == AV_NOPTS_VALUE && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO || st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
> +            if(st->first_dts == AV_NOPTS_VALUE &&
> +               !(ic->iformat->flags & AVFMT_NOTIMESTAMPS) &&
> +               (st->codec->codec_type == AVMEDIA_TYPE_VIDEO || st->codec->codec_type == AVMEDIA_TYPE_AUDIO)) {
>                  break;
> +            }
>          }
>          if (i == ic->nb_streams) {
>              /* NOTE: if the format has no header, then we need to read
> 
> 
> But this breaks at least some DTS detection doing the same with MP3
> (seek-mp2).
> 
> Any hint on how to fix this properly are welcome.

can you post the diff from the seektest failur ?

[..]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120127/51320b1d/attachment.asc>


More information about the ffmpeg-devel mailing list