Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13751

bug in function readData() at NokiaQTSDK\Examples\4.6\multimedia\audiooutput\audiooutput.cpp example

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.2
    • 4.7.0
    • Multimedia
    • None
    • NOKIA QTSDK on WIN XP

    Description

      there is an error in the readData function implementation
      at line 138
      memcpy(data, m_buffer.constData() + m_pos, chunk);
      should be
      memcpy(data+total, m_buffer.constData() + m_pos, chunk);

      in fact in the while loop it does not advance the pointer to data so that it override the previous sound samples causing rumours in the ouput sound

      i started my code from example and i discover it while debugging an audible click/rumours in the sound .
      As i fixed it , sound plays clean

      just to be sure where in the code ,this is the function
      qint64 Generator::readData(char *data, qint64 len)
      {
      qint64 total = 0;
      while (len - total)

      { const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total); memcpy(data, m_buffer.constData() + m_pos, chunk); //BUG m_pos = (m_pos + chunk) % m_buffer.size(); total += chunk; }

      return total;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            lucarocchi Luca Rocchi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes