diff mbox series

[FFmpeg-devel,v2,3/8] avformat/mov: base the endianness on just the LSB

Message ID tencent_8B4545130C684773FD936F95D1890F0EBB05@qq.com
State Accepted
Commit 912ac82a3c769792ad992534f3df9b0a549ff827
Headers show
Series [FFmpeg-devel,v2,1/8] avformat/movenc: add PCM in mp4 support | 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

Zhao Zhili Feb. 24, 2023, 6:28 p.m. UTC
From: Jan Ekström <jeebjp@gmail.com>

As per 23003-5:2020, the rest of the bits are reserved, and thus
in the future they may be utilized for something else.

Quote:
format_flags is a field of flags that modify the default PCM sample format.
Undefined flags are reserved and shall be zero. The following flag is defined:
  0x01 indicates little-endian format. If not present, big-endian format is used.
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomas Härdin Feb. 27, 2023, 1:36 p.m. UTC | #1
lör 2023-02-25 klockan 02:28 +0800 skrev Zhao Zhili:
> From: Jan Ekström <jeebjp@gmail.com>
> 
> As per 23003-5:2020, the rest of the bits are reserved, and thus
> in the future they may be utilized for something else.
> 
> Quote:
> format_flags is a field of flags that modify the default PCM sample
> format.
> Undefined flags are reserved and shall be zero. The following flag is
> defined:
>   0x01 indicates little-endian format. If not present, big-endian
> format is used.
> ---
>  libavformat/mov.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index cdd44a9e44..a9911c0f79 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -1608,7 +1608,7 @@ static int mov_read_pcmc(MOVContext *c,
> AVIOContext *pb, MOVAtom atom)
>      }
>  
>      format_flags = avio_r8(pb);
> -    if (format_flags == 1) // indicates little-endian format. If not
> present, big-endian format is used
> +    if (format_flags & 1) // indicates little-endian format. If not
> present, big-endian format is used

Should be OK.

/Tomas
Jan Ekström March 5, 2023, 10:01 p.m. UTC | #2
On Mon, Feb 27, 2023 at 3:37 PM Tomas Härdin <git@haerdin.se> wrote:
>
> lör 2023-02-25 klockan 02:28 +0800 skrev Zhao Zhili:
> > From: Jan Ekström <jeebjp@gmail.com>
> >
> > As per 23003-5:2020, the rest of the bits are reserved, and thus
> > in the future they may be utilized for something else.
> >
> > Quote:
> > format_flags is a field of flags that modify the default PCM sample
> > format.
> > Undefined flags are reserved and shall be zero. The following flag is
> > defined:
> >   0x01 indicates little-endian format. If not present, big-endian
> > format is used.
> > ---
> >  libavformat/mov.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index cdd44a9e44..a9911c0f79 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -1608,7 +1608,7 @@ static int mov_read_pcmc(MOVContext *c,
> > AVIOContext *pb, MOVAtom atom)
> >      }
> >
> >      format_flags = avio_r8(pb);
> > -    if (format_flags == 1) // indicates little-endian format. If not
> > present, big-endian format is used
> > +    if (format_flags & 1) // indicates little-endian format. If not
> > present, big-endian format is used
>
> Should be OK.

Applied as 912ac82a3c769792ad992534f3df9b0a549ff827 to make this set
under review shorter, with a minor improvement to the commit message
("base *pcmC* endianness on just the LSB")

Jan
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index cdd44a9e44..a9911c0f79 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1608,7 +1608,7 @@  static int mov_read_pcmc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     }
 
     format_flags = avio_r8(pb);
-    if (format_flags == 1) // indicates little-endian format. If not present, big-endian format is used
+    if (format_flags & 1) // indicates little-endian format. If not present, big-endian format is used
         set_last_stream_little_endian(c->fc);
 
     return 0;