[FFmpeg-devel] [PATCH 2/2] riffdec: override bits per sample for G.729 as well

Michael Niedermayer michael at niedermayer.cc
Thu Jul 30 15:31:48 CEST 2015


On Wed, Jul 29, 2015 at 12:28:47AM -0400, Ganesh Ajjanagadde wrote:
> May be used to fix Ticket4577
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavformat/riffdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
> index 7eecdb2..43d4cfc 100644
> --- a/libavformat/riffdec.c
> +++ b/libavformat/riffdec.c
> @@ -176,8 +176,8 @@ int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
>          codec->channels    = 0;
>          codec->sample_rate = 0;
>      }
> -    /* override bits_per_coded_sample for G.726 */
> -    if (codec->codec_id == AV_CODEC_ID_ADPCM_G726 && codec->sample_rate)
> +    /* override bits_per_coded_sample for G.726  and G.729 */
> +    if ((codec->codec_id == AV_CODEC_ID_ADPCM_G726 || codec->codec_id == AV_CODEC_ID_G729) && codec->sample_rate)
>          codec->bits_per_coded_sample = codec->bit_rate / codec->sample_rate;

This feels somewhat wrong
G729 doesnt really code each sample in 1 or 0.8 bits, also the
6.4kbit/sec mode would end with a 0 here

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150730/a6ec0251/attachment.sig>


More information about the ffmpeg-devel mailing list