diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2015-02-03 20:08:51 +0100 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2015-02-03 20:08:51 +0100 |
| commit | b88c0ed35fa6f215bc5ffb7a79bdcdaef5578ed2 (patch) | |
| tree | ab1b95db5d1fdac0424a2f0dcb9001e35489c918 | |
| parent | 8e2fa20663aaea55ceec303d5f11a27a2e7e4df8 (diff) | |
| download | vdr-plugin-rpihddevice-b88c0ed35fa6f215bc5ffb7a79bdcdaef5578ed2.tar.gz vdr-plugin-rpihddevice-b88c0ed35fa6f215bc5ffb7a79bdcdaef5578ed2.tar.bz2 | |
don't clear audio PTS when parser shrinks the packet buffer
| -rw-r--r-- | HISTORY | 3 | ||||
| -rw-r--r-- | audio.c | 17 |
2 files changed, 11 insertions, 9 deletions
@@ -1,6 +1,9 @@ VDR Plugin 'rpihddevice' Revision History ----------------------------------------- +- fixed: + - don't clear audio PTS when parser shrinks the packet buffer + 2015-01-21: Version 0.0.11 -------------------------- - new: @@ -196,7 +196,7 @@ public: return ret; } - void Shrink(unsigned int length) + void Shrink(unsigned int length, bool retainPts = false) { m_mutex->Lock(); @@ -206,11 +206,6 @@ public: m_size -= length; memset(m_packet.data + m_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); - // clear current PTS since it's not valid anymore after - // shrinking the packet - if (!m_ptsQueue.empty()) - m_ptsQueue.front()->pts = 0; - while (!m_ptsQueue.empty() && length) { if (m_ptsQueue.front()->length <= length) @@ -221,8 +216,12 @@ public: } else { - m_ptsQueue.front()->pts = 0; - length -= m_ptsQueue.front()->length -= length; + // clear current PTS since it's not valid anymore after + // shrinking the packet + if (!retainPts) + m_ptsQueue.front()->pts = 0; + + m_ptsQueue.front()->length -= length; length = 0; } } @@ -321,7 +320,7 @@ private: if (offset) { DBG("audio parser skipped %u of %u bytes", offset, m_size); - Shrink(offset); + Shrink(offset, true); } if (codec != cAudioCodec::eInvalid) |
