On Mon, Nov 27, 2017 at 03:20:10PM -0500, Vittorio Giovara wrote:
> Signed-off-by: Vittorio Giovara <vittorio.giov...@gmail.com>
> ---
>  libavformat/mov.c | 71 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 71 insertions(+)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 79023ef369..bb463017a3 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -5072,6 +5072,51 @@ static int mov_read_smdm(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>      return 0;
>  }
>  
> +static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> +{
> +    MOVStreamContext *sc;
> +    const int mapping[3] = {1, 2, 0};
> +    const int chroma_den = 50000;
> +    const int luma_den = 10000;
> +    int i;
> +
> +    if (c->fc->nb_streams < 1)
> +        return AVERROR_INVALIDDATA;
> +
> +    sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data;
> +
> +    if (atom.size < 24) {
> +        av_log(c->fc, AV_LOG_ERROR, "Invalid Mastering Display Color Volume 
> box\n");
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    sc->mastering = av_mastering_display_metadata_alloc();
> +    if (!sc->mastering)
> +        return AVERROR(ENOMEM);
> +
> +    for (i = 0; i < 3; i++) {
> +        const int j = mapping[i];

rather minor suggestion but you could use:
 ((int[]){ 1, 2, 0 })[i];

as mapping is not used anywhere else

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to