On Mon, Aug 19, 2013 at 04:05:31PM -0700, John Stebbins wrote:
> From: Clément Bœsch <[email protected]>
> 
> Faststart moves moov atom to beginning of file and rewrites the reset of
> the file after muxing is complete.

the moov atom to the beginning of the file, reST

> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -51,6 +51,7 @@ static const AVOption options[] = {
>      { "separate_moof", "Write separate moof/mdat atoms for each track", 0, 
> AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_SEPARATE_MOOF}, INT_MIN, INT_MAX, 
> AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
>      { "frag_custom", "Flush fragments on caller requests", 0, 
> AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FRAG_CUSTOM}, INT_MIN, INT_MAX, 
> AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
>      { "isml", "Create a live smooth streaming feed (for pushing to a 
> publishing point)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_ISML}, INT_MIN, 
> INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
> +    { "faststart", "Run a second pass to put the moov at the beginning of 
> the file", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FASTSTART}, INT_MIN, 
> INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },

I'd say "moov atom" or just "index".  Not everybody reading this need
be familiar with MOV internals.

> @@ -3195,6 +3206,115 @@ static int mov_write_header(AVFormatContext *s)
> +
> +/**
> + * This function gets the moov size if moved to the top of the file: the 
> chunk
> + * offset table can switch between stco (32-bit entries) to co64 (64-bit
> + * entries) when the moov is moved to the top, so the size of the moov would
> + * change. It also updates the chunk offset tables.
> + */
> +static int compute_moov_size(AVFormatContext *s)

There is no reason for this comment to be Doxygen.

I'd speak of the "beginning" of the file, "top of the file" sounds
just weird.

> +    /* if the size changed, we just switched from stco to co64 and needs to
> +     * update the offsets */

and need_ to

> @@ -3229,9 +3349,20 @@ static int mov_write_trailer(AVFormatContext *s)
>              ffio_wfourcc(pb, "mdat");
>              avio_wb64(pb, mov->mdat_size + 16);
>          }
> +
> +
>          avio_seek(pb, moov_pos, SEEK_SET);

stray change

> -        mov_write_moov_tag(pb, mov, s);
> +        if (mov->flags & FF_MOV_FLAG_FASTSTART) {
> +            av_log(s, AV_LOG_INFO, "Starting second pass: moving header on 
> top of the file\n");

"header"?  Shouldn't this be "index"?  Also, the "top of the file"
is still weird.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to