[FFmpeg-devel] [PATCH] aiffenc: set correct number of bits for u8 in aiff

Peter Ross pross at xvid.org
Wed Dec 12 21:07:38 CET 2012


On Wed, Dec 12, 2012 at 05:09:42PM +0100, Piotr Bandurski wrote:
> with this change QuickTime is able to play u8 aiff file generated by FFmpeg

> diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
> index 8cdb261..78c5ae3 100644
> --- a/libavformat/aiffenc.c
> +++ b/libavformat/aiffenc.c
> @@ -53,6 +53,9 @@ static int aiff_write_header(AVFormatContext *s)
>      ffio_wfourcc(pb, aifc ? "AIFC" : "AIFF");
>  
>      if (aifc) { // compressed audio
> +    if (enc->codec_tag == MKTAG('r','a','w',' '))
> +        enc->bits_per_coded_sample = 8;
> +    else
>          enc->bits_per_coded_sample = 16;
>          if (!enc->block_align) {
>              av_log(s, AV_LOG_ERROR, "block align not set\n");

what if you just remove the 'enc->bits_per_coded_sample = 16;' line?

as further down the function there is:

    if (!enc->bits_per_coded_sample)
        enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id);

which should calculate the correct value.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121213/e3a08334/attachment.asc>


More information about the ffmpeg-devel mailing list