[FFmpeg-devel] [PATCH] mxfdec: calculate the index in display order

Tomas Härdin tomas.hardin at codemill.se
Tue Jul 14 22:55:07 CEST 2015


On Sat, 2015-07-11 at 18:54 +0200, Marton Balint wrote:
> This should fix seeking for open GOP files as well.
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> @@ -1411,8 +1417,7 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
>                  break;
>              }
>  
> -            index_table->fake_index[x].timestamp = x;

Why is this removed?

> -            index_table->fake_index[x].flags = !(s->flag_entries[j] & 0x30) ? AVINDEX_KEYFRAME : 0;
> +            flags[x] = !(s->flag_entries[j] & 0x30) ? AVINDEX_KEYFRAME : 0;
>  
>              if (index < 0 || index >= index_table->nb_ptses) {
>                  av_log(mxf->fc, AV_LOG_ERROR,
> @@ -1421,11 +1426,20 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
>                  continue;
>              }
>  
> +            index_table->offsets[x] = offset;
>              index_table->ptses[index] = x;
>              max_temporal_offset = FFMAX(max_temporal_offset, offset);
>          }
>      }
>  
> +    /* calculate the fake index table in display order */
> +    for (x = 0; x < index_table->nb_ptses; x++) {
> +        index_table->fake_index[x].timestamp = x;
> +        if (index_table->ptses[x] != AV_NOPTS_VALUE)
> +            index_table->fake_index[index_table->ptses[x]].flags = flags[x];

ptses are checked to be in range, right?

Anyway, the patch is probably OK. I recall doing something similar at
work in another mxf library. Do we have test files with B-frames? If not
then this may be a good time to add them.

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150714/bdad1ad7/attachment.sig>


More information about the ffmpeg-devel mailing list