Re: [AD] SAMPLE loading problem |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2005-11-11, Vincent Penecherc'h <Vincent.Penecherch@xxxxxxxxxx> wrote:
> I also found this. I recall having problems loading some
> sound files, and I had to do this to make it work. The
> samples were then loaded correctly.
>
> I don't quite understand why the code was done that way,
> as AFAIK any 16 bit value can be stored as a sample in a
> sound file, so testing against EOF is damaging, as it'd
> flag as bad any file containing such a sample.
I don't think so. The way pack_igetw is implemented, a 16-bit -1 will
be returned as 0x0000FFFF rather than 0xFFFFFFFF, hence the test against
EOF should be safe. See the code a bit further down from your patched
lines which casts the value to a signed short.
Of course, if you have a counter-example...
Peter