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

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 4.7.0
    • Fix Version/s: 4.7.2
    • Component/s: Multimedia
    • Labels:
      None
    • Environment:
      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

            • Assignee:
              denexter Andrew den Exter (closed Nokia identity) (Inactive)
              Reporter:
              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