[FFmpeg-devel] [PATCH 18/21] libavformat/movenc: mov_write_audio_tag writes the proper number of channels, not the hardcoded 2

Yusuke Nakamura muken.the.vfrmaniac at gmail.com
Tue Aug 23 18:20:42 EEST 2016


2016-08-23 18:03 GMT+09:00 <erkki.seppala.ext at nokia.com>:

> From: Erkki Seppälä <erkki.seppala.ext at nokia.com>
>
> Signed-off-by: Erkki Seppälä <erkki.seppala.ext at nokia.com>
> Signed-off-by: OZOPlayer <OZOPL at nokia.com>
> ---
>  libavformat/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 94d978b..020d13d 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1039,7 +1039,7 @@ static int mov_write_audio_tag(AVFormatContext *s,
> AVIOContext *pb, MOVMuxContex
>                  avio_wb16(pb, 16);
>              avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
>          } else { /* reserved for mp4/3gp */
> -            avio_wb16(pb, 2);
> +            avio_wb16(pb, track->par->channels);
>

No. the ChannelCount field is templated. It may be fixed to 2 by derived
specs or the specs of codec encapsulations. I mean the current
implemetation is wrong, and your implementation is also wrong. For
instance, ChannelCount of AC-3 in ISOBMFF is always hardcoded to 2 even if
5.1ch. This field is basically not useful for ISOBMFF and the actual
channels shall be referred to Codec specific info.

             avio_wb16(pb, 16);
>              avio_wb16(pb, 0);
>          }
> --
> 2.7.4
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list