• Max Kellermann's avatar
    output/alsa: check ring buffer space before writing to it · 0a32634d
    Max Kellermann authored
    Pass only the amount of data to PcmExport::Export() when its full
    output fits into the ring buffer.  Using only a part of the
    PcmExport::Export() result may cause data corruption because
    PcmExport's internal state may contain partial blocks which would need
    to be rolled back when only some of its output data was used.
    
    As a side effect, this fixes an assertion failure because
    PcmExport::CalcInputSize() considered partial block data and could
    cause Play() to return a number larger than the "size" parameter.
    0a32634d
AlsaOutputPlugin.cxx 27.2 KB