VirtualBox

Changeset 35116 in vbox for trunk/src


Ignore:
Timestamp:
Dec 15, 2010 9:54:48 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68950
Message:

Audio: some santiy checks (debug only)

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/audio.c

    r34906 r35116  
    937937        }
    938938
     939        if (ret + osamp > sw->buf_samples)
     940            Log(("audio_pcm_sw_read: buffer overflow!! ret = %d, osamp = %d, buf_samples = %d\n",
     941                  ret, osamp, sw->buf_samples));
    939942        st_rate_flow (sw->rate, src, dst, &isamp, &osamp);
    940943        swlim -= osamp;
     
    945948    }
    946949
     950    if (ret > sw->buf_samples)
     951        Log(("audio_pcm_sw_read: buffer overflow!! ret = %d, buf_samples = %d\n", ret, sw->buf_samples));
    947952    sw->clip (buf, sw->buf, ret);
    948953    sw->total_hw_samples_acquired += total;
     
    10361041    swlim = ((int64_t) dead << 32) / sw->ratio;
    10371042    swlim = audio_MIN (swlim, samples);
     1043    if (swlim > sw->buf_samples)
     1044        Log(("audio_pcm_sw_write: buffer overflow!! swlim = %d, buf_samples = %d\n",
     1045             swlim, pos, sw->buf_samples));
    10381046    if (swlim) {
    10391047#ifndef VBOX
     
    10531061        isamp = swlim;
    10541062        osamp = blck;
     1063        if (pos + isamp > sw->buf_samples)
     1064            Log(("audio_pcm_sw_write: buffer overflow!! isamp = %d, pos = %d, buf_samples = %d\n",
     1065                 isamp, pos, sw->buf_samples));
    10551066        st_rate_flow_mix (
    10561067            sw->rate,
  • trunk/src/VBox/Devices/Audio/audio_int.h

    r35110 r35116  
    122122    int64_t ratio;
    123123    st_sample_t *buf;
     124    int buf_samples;
    124125    void *rate;
    125126    int total_hw_samples_mixed;
     
    140141    int total_hw_samples_acquired;
    141142    st_sample_t *buf;
     143    int buf_samples; /* for debugging only */
    142144    f_sample *clip;
    143145    HWVoiceIn *hw;
  • trunk/src/VBox/Devices/Audio/audio_template.h

    r35112 r35116  
    105105    sw->buf = NULL;
    106106    sw->rate = NULL;
     107    sw->buf_samples = 0;
    107108}
    108109
     
    112113
    113114    samples = ((int64_t) sw->hw->samples << 32) / sw->ratio;
     115    sw->buf_samples = 0;
    114116
    115117    sw->buf = audio_calloc (AUDIO_FUNC, samples, sizeof (st_sample_t));
     
    130132        return -1;
    131133    }
     134
     135    sw->buf_samples = samples;
    132136    return 0;
    133137}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette