[FFmpeg-devel] mov/mp4 found_moov variable uninitialized

Frank Barchard fbarchard
Thu Jun 25 11:56:54 CEST 2009


On Thu, Jun 25, 2009 at 2:25 AM, Baptiste Coudurier <
baptiste.coudurier at gmail.com> wrote:

> Frank Barchard wrote:
> > On Thu, Jun 25, 2009 at 2:13 AM, Baptiste Coudurier <
> > baptiste.coudurier at gmail.com> wrote:
> >
> >> Hi,
> >>
> >> Frank Barchard wrote:
> >>> when opening a mov/mp4 with is_streamed, the following statement stops
> >>> parsing, avoiding unnecessary seeks to end of file
> >>>
> >>>             if (url_is_streamed(pb) && c->found_moov && c->found_mdat)
> >>>                break;
> >>>
> >>>
> >>> but if you close/shutdown and open a new movie, found_mdat is reset to
> >>> 0, but found_moov is not.
> >> What do you mean by "close/shutdown" av_close_input_stream ?
> >> In this case everything is reset.
> >>
> >>> [...]
> >>>
> >>> --- libavformat/mov.orig.c      2009-06-24 23:45:32.099461400 -0700
> >>> +++ libavformat/mov.c   2009-06-24 23:45:37.755675200 -0700
> >>> @@ -1958,6 +1958,7 @@ static int mov_read_packet(AVFormatConte
> >>>      }
> >>>      if (!sample) {
> >>>          mov->found_mdat = 0;
> >>> +        mov->found_moov = 0;
> >>>          if (!url_is_streamed(s->pb) ||
> >>>              mov_read_default(mov, s->pb, (MOVAtom){ 0, 0, INT64_MAX })
> <
> >> 0
> >>
> >> This breaks fragments demuxing.
> >
> >
> > doh!  I haven't seen an example of fragments.
> > Can you confirm the bug,
> > and suggest a better location to initialize the variable?
>
> Once you will explain me what you mean by "close/shutdown" :)

*
*
We call av_open_input_file() on a different file. I'm also not clear on our
close... I think we only call av_free_packet(). With fmp4 there is one moov
header and multiple mdats is there? Would mov_read_close() be a safe place
to add found_moov = 0; ?
*
*
*--- libavformat/mov.orig.c      2009-06-24 23:45:32.099461400 -0700
+++ libavformat/mov.c   2009-06-25 02:55:05.761044500 -0700
@@ -2100,6 +2100,7 @@ static int mov_read_close(AVFormatContex
     }

     av_freep(&mov->trex_data);
+    mov->found_moov = 0;

     return 0;
 }
*
*
*


>
>
> --
> Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> FFmpeg maintainer                                  http://www.ffmpeg.org
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



More information about the ffmpeg-devel mailing list