[08/10] movenc: Add tfra entries for all tracks in a moof

Message ID 1415365019-26521-8-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö Nov. 7, 2014, 12:56 p.m.
Previously only tfra entries were added for the first track in each moof.

The frag_info array used for tfra can also be used for writing
other kinds of fragment indexes, where it's more important to
include all tracks.
---
 libavformat/movenc.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Luca Barbato Nov. 7, 2014, 1:56 p.m. | #1
On 07/11/14 13:56, Martin Storsjö wrote:
> Previously only tfra entries were added for the first track in each moof.
>
> The frag_info array used for tfra can also be used for writing
> other kinds of fragment indexes, where it's more important to
> include all tracks.
> ---
>   libavformat/movenc.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 157ca17..c7fa8d4 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -2600,10 +2600,6 @@ static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int tracks)
>                            track->cluster[0].dts;
>           info->tfrf_offset = 0;
>           mov_write_tfrf_tags(pb, mov, track);
> -        // If writing all tracks, we currently only add a tfra entry for
> -        // the first track (that actually has data to be written).
> -        if (tracks < 0)
> -            break;
>       }
>       return 0;
>   }
>

Seems ok.
Derek Buitenhuis Nov. 14, 2014, 2:29 p.m. | #2
On 11/7/2014 12:56 PM, Martin Storsjö wrote:
> Previously only tfra entries were added for the first track in each moof.
> 
> The frag_info array used for tfra can also be used for writing
> other kinds of fragment indexes, where it's more important to
> include all tracks.
> ---
>  libavformat/movenc.c | 4 ----
>  1 file changed, 4 deletions(-)

OK.

- Derek

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 157ca17..c7fa8d4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2600,10 +2600,6 @@  static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int tracks)
                          track->cluster[0].dts;
         info->tfrf_offset = 0;
         mov_write_tfrf_tags(pb, mov, track);
-        // If writing all tracks, we currently only add a tfra entry for
-        // the first track (that actually has data to be written).
-        if (tracks < 0)
-            break;
     }
     return 0;
 }