[Ffmpeg-devel] Does FLAC decoder support 24-bit files?

Mike Melanson mike
Tue Oct 25 22:13:05 CEST 2005

Mike Melanson wrote:
>  I
> imagine that the truncating behavior is not correct in this case.

	Sure enough:

#include <stdio.h>
#include <inttypes.h>
int main() {
     int16_t hey;
     int32_t you = 0x10001;
     hey = you;
     printf ("hey = %d, you = %d\n", hey, you);
     return 0;

[melanson at yavin4 melanson]$ gcc -Wall truncate.c -o truncate
[melanson at yavin4 melanson]$ ./truncate
hey = 1, you = 65537

So the high-order bits are just chopped off. I am a little surprised 
that gcc does not offer a warning on the "hey = you;" assignment (should 
I be?). Version 3.3.5, x86.

	-Mike Melanson

More information about the ffmpeg-devel mailing list