Ignore:
Timestamp:
2012-07-13T16:11:05Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
13df13c8
Parents:
6424800
Message:

hound: Use buffer position in source available data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_format.c

    r6424800 rab07cf0  
    5555                return EINVAL;
    5656        const size_t sample_size = pcm_sample_format_size(f->sample_format);
    57         if (!(size % sample_size == 0))
     57        if ((size % sample_size) != 0)
    5858                return EINVAL;
    5959
     
    6565        const type *src_buff = src; \
    6666        type *dst_buff = dst; \
    67         for (size_t i = 0; i < size / sample_size; ++i) { \
    68                 type a = type ## _ ## endian ##2host(dst_buff[i]); \
    69                 type b = type ## _ ## endian ##2host(src_buff[i]); \
    70                 type c = a + b; \
     67        for (size_t i = 0; i < size / sizeof(type); ++i) { \
     68                const type a = type ## _ ## endian ##2host(dst_buff[i]); \
     69                const type b = type ## _ ## endian ##2host(src_buff[i]); \
     70                const type c = a + b; \
    7171                dst_buff[i] = host2 ## type ## _ ## endian(c); \
    7272        } \
Note: See TracChangeset for help on using the changeset viewer.