Ignore:
Timestamp:
2012-07-13T16:11:05Z (13 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_source.c

    r6424800 rab07cf0  
    6464        source->format = *f;
    6565        source->available_data.base = NULL;
     66        source->available_data.position = NULL;
    6667        source->available_data.size = 0;
    6768        log_verbose("Initialized source (%p) '%s'", source, source->name);
     
    119120                return ENOTSUP;
    120121        }
    121         if (source->available_data.base == NULL ||
     122        if (source->available_data.position == NULL ||
    122123            source->available_data.size == 0) {
    123124                int ret = EOVERFLOW; /* In fact this is underflow... */
     
    125126                        ret = source->update_available_data(source, size);
    126127                if (ret != EOK) {
    127                         log_debug("No data to add");
     128                        log_debug("No data to add to %p(%zu)", buffer, size);
    128129                        return ret;
    129130                }
     
    132133        const size_t real_size = min(size, source->available_data.size);
    133134        const int ret =
    134             audio_format_mix(buffer, source->available_data.base, real_size, f);
     135            audio_format_mix(buffer, source->available_data.position, real_size, f);
    135136        if (ret != EOK) {
    136                 log_debug("Mixing failed");
     137                log_debug("Mixing failed %p <= %p, %zu",
     138                    buffer, source->available_data.position, real_size);
    137139                return ret;
    138140        }
    139         source->available_data.base += real_size;
     141
     142        source->available_data.position += real_size;
    140143        source->available_data.size -= real_size;
     144
     145        log_verbose("Mixing successful %p <= %p, %zu",
     146            buffer, source->available_data.position, real_size);
     147
    141148        buffer += real_size;
    142149        size -= real_size;
Note: See TracChangeset for help on using the changeset viewer.