On Fri, Oct 3, 2014 at 12:56 PM, Anton Khirnov <an...@khirnov.net> wrote:
> Quoting Vittorio Giovara (2014-10-02 20:53:40)
>> ---
>>  libavformat/mov.c | 80 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 80 insertions(+)
>>
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index 3734689..fd79e6f 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -887,6 +887,85 @@ static int mov_read_enda(MOVContext *c, AVIOContext 
>> *pb, MOVAtom atom)
>>      return 0;
>>  }
>>
>> +static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>> +{
>> +    AVStream *st;
>> +    char color_parameter_type[5] = { 0 };
>> +    int color_primaries, color_trc, color_matrix;
>> +
>> +    if (c->fc->nb_streams < 1)
>> +        return 0;
>> +    st = c->fc->streams[c->fc->nb_streams - 1];
>> +
>> +    avio_read(pb, color_parameter_type, 4);
>> +    if (c->isom) {
>> +        if (!strncmp(color_parameter_type, "prof", 4) ||
>> +            !strncmp(color_parameter_type, "rICC", 4)) {
>> +            avpriv_report_missing_feature(c->fc, "'%s' color parameter 
>> type",
>> +                                          color_parameter_type);
>> +            return 0;
>> +        } else if (strncmp(color_parameter_type, "nclx", 4)) {
>> +            return AVERROR_INVALIDDATA;
>> +        }
>> +    } else {
>> +        if (!strncmp(color_parameter_type, "prof", 4)) {
>> +            avpriv_report_missing_feature(c->fc, "'prof' color parameter 
>> type");
>> +            return 0;
>> +        } else if (strncmp(color_parameter_type, "nclc", 4)) {
>> +            return AVERROR_INVALIDDATA;
>> +        }
>> +    }
>
> The error handling here seems to be a bit random -- I fail to see any
> pattern in the return values. IMO either all of those should be
> AVERROR_INVALIDDATA, or they should all be 0.

isom supports 'prof' 'rICC' and 'nclx', while qt supports 'prof' and 'nclc'.
This patch adds supports for nclc and nclx, returns 0 for 'rICC' and
'prof' because they are not implemented, and returns INVALIDDATA for
anything else.

-- 
Vittorio
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to