matroskadec: don't warn about unknown spherical medata when none is present

Message ID 20171102140303.9476-1-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer Nov. 2, 2017, 2:03 p.m.
track->video.projection.type is 0 by default, and is the value set by the
demuxer for files without the element.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/matroskadec.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Luca Barbato Nov. 2, 2017, 3:01 p.m. | #1
On 02/11/2017 15:03, James Almer wrote:
> track->video.projection.type is 0 by default, and is the value set by the
> demuxer for files without the element.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   libavformat/matroskadec.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index c6e1a190a8..5ed03bb642 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -1659,9 +1659,6 @@ static int mkv_parse_video_projection(AVStream *st, const MatroskaTrack *track)
>           }
>           break;
>       default:
> -        av_log(NULL, AV_LOG_WARNING,
> -               "Unknown spherical metadata type %"PRIu64"\n",
> -               track->video.projection.type);
>           return 0;
>       }
>   
> 

not sure if would be overkill add a

0: return 0; // nothing to do

or such.
James Almer Nov. 2, 2017, 3:14 p.m. | #2
On 11/2/2017 12:01 PM, Luca Barbato wrote:
> On 02/11/2017 15:03, James Almer wrote:
>> track->video.projection.type is 0 by default, and is the value set by the
>> demuxer for files without the element.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavformat/matroskadec.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
>> index c6e1a190a8..5ed03bb642 100644
>> --- a/libavformat/matroskadec.c
>> +++ b/libavformat/matroskadec.c
>> @@ -1659,9 +1659,6 @@ static int mkv_parse_video_projection(AVStream
>> *st, const MatroskaTrack *track)
>>           }
>>           break;
>>       default:
>> -        av_log(NULL, AV_LOG_WARNING,
>> -               "Unknown spherical metadata type %"PRIu64"\n",
>> -               track->video.projection.type);
>>           return 0;
>>       }
>>  
> 
> not sure if would be overkill add a
> 
> 0: return 0; // nothing to do
> 
> or such.

I don't think that's a good idea. There are projections we don't support
which need to be handled by default:.
Unless of course you prefer handling actual projection values we don't
support and 0 ("rectangular" as called by Mastroska, which is the same
as none) in a different way.

Patch

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c6e1a190a8..5ed03bb642 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1659,9 +1659,6 @@  static int mkv_parse_video_projection(AVStream *st, const MatroskaTrack *track)
         }
         break;
     default:
-        av_log(NULL, AV_LOG_WARNING,
-               "Unknown spherical metadata type %"PRIu64"\n",
-               track->video.projection.type);
         return 0;
     }