diff mbox series

[FFmpeg-devel,v2] avformat/mov: fix 2 compile errors

Message ID 20230316053258.265-1-tong1.wu@intel.com
State New
Headers show
Series [FFmpeg-devel,v2] avformat/mov: fix 2 compile errors | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Wu, Tong1 March 16, 2023, 5:32 a.m. UTC
Compiler: MSVC 14.35.32215
Error type: error C2059: syntax error: '}'
Related commit: 9e1ffed fate/mov: add PCM in mp4 test
d7e8643 avformat/mov: parse ISO-14496-12 ChannelLayout

Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
 libavformat/mov_chan.c | 2 +-
 libavformat/movenc.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Xiang, Haihao March 16, 2023, 5:48 a.m. UTC | #1
On Do, 2023-03-16 at 13:32 +0800, Tong Wu wrote:
> Compiler: MSVC 14.35.32215
> Error type: error C2059: syntax error: '}'
> Related commit: 9e1ffed fate/mov: add PCM in mp4 test
> d7e8643 avformat/mov: parse ISO-14496-12 ChannelLayout
> 
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
>  libavformat/mov_chan.c | 2 +-
>  libavformat/movenc.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
> index df17976e59..f3d51899e1 100644
> --- a/libavformat/mov_chan.c
> +++ b/libavformat/mov_chan.c
> @@ -555,7 +555,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb,
> AVStream *st,
>  /* ISO/IEC 23001-8, 8.2 */
>  static const AVChannelLayout iso_channel_configuration[] = {
>      // 0: any setup
> -    {},
> +    {0},
>  
>      // 1: centre front
>      AV_CHANNEL_LAYOUT_MONO,
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 2ec575c954..68e7f8222b 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1194,7 +1194,7 @@ static int mov_write_chnl_tag(AVFormatContext *s,
> AVIOContext *pb, MOVTrack *tra
>          ret = ff_mov_get_channel_positions_from_layout(layout,
>                  speaker_pos, layout->nb_channels);
>          if (ret) {
> -            char buf[128] = {};
> +            char buf[128] = {0};
>  
>              av_freep(&speaker_pos);
>              av_channel_layout_describe(layout, buf, sizeof(buf));

LGTM.

- Haihao
Zhao Zhili March 16, 2023, 7:01 a.m. UTC | #2
> On Mar 16, 2023, at 13:48, Xiang, Haihao <haihao.xiang-at-intel.com@ffmpeg.org> wrote:
> 
> On Do, 2023-03-16 at 13:32 +0800, Tong Wu wrote:
>> Compiler: MSVC 14.35.32215
>> Error type: error C2059: syntax error: '}'
>> Related commit: 9e1ffed fate/mov: add PCM in mp4 test
>> d7e8643 avformat/mov: parse ISO-14496-12 ChannelLayout
>> 
>> Signed-off-by: Tong Wu <tong1.wu@intel.com>
>> ---
>>  libavformat/mov_chan.c | 2 +-
>>  libavformat/movenc.c   | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
>> index df17976e59..f3d51899e1 100644
>> --- a/libavformat/mov_chan.c
>> +++ b/libavformat/mov_chan.c
>> @@ -555,7 +555,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb,
>> AVStream *st,
>>  /* ISO/IEC 23001-8, 8.2 */
>>  static const AVChannelLayout iso_channel_configuration[] = {
>>      // 0: any setup
>> -    {},
>> +    {0},
>>  
>>      // 1: centre front
>>      AV_CHANNEL_LAYOUT_MONO,
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index 2ec575c954..68e7f8222b 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -1194,7 +1194,7 @@ static int mov_write_chnl_tag(AVFormatContext *s,
>> AVIOContext *pb, MOVTrack *tra
>>          ret = ff_mov_get_channel_positions_from_layout(layout,
>>                  speaker_pos, layout->nb_channels);
>>          if (ret) {
>> -            char buf[128] = {};
>> +            char buf[128] = {0};
>>  
>>              av_freep(&speaker_pos);
>>              av_channel_layout_describe(layout, buf, sizeof(buf));
> 
> LGTM.
> 
> - Haihao

Applied as c3a79990. Thanks for the fix and patch review. Didn’t notice
it’s GNU extension until C23.

> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index df17976e59..f3d51899e1 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -555,7 +555,7 @@  int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
 /* ISO/IEC 23001-8, 8.2 */
 static const AVChannelLayout iso_channel_configuration[] = {
     // 0: any setup
-    {},
+    {0},
 
     // 1: centre front
     AV_CHANNEL_LAYOUT_MONO,
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2ec575c954..68e7f8222b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1194,7 +1194,7 @@  static int mov_write_chnl_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
         ret = ff_mov_get_channel_positions_from_layout(layout,
                 speaker_pos, layout->nb_channels);
         if (ret) {
-            char buf[128] = {};
+            char buf[128] = {0};
 
             av_freep(&speaker_pos);
             av_channel_layout_describe(layout, buf, sizeof(buf));