summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2015-02-03 20:08:51 +0100
committerThomas Reufer <thomas@reufer.ch>2015-02-03 20:08:51 +0100
commitb88c0ed35fa6f215bc5ffb7a79bdcdaef5578ed2 (patch)
treeab1b95db5d1fdac0424a2f0dcb9001e35489c918
parent8e2fa20663aaea55ceec303d5f11a27a2e7e4df8 (diff)
downloadvdr-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--HISTORY3
-rw-r--r--audio.c17
2 files changed, 11 insertions, 9 deletions
diff --git a/HISTORY b/HISTORY
index 949f2d9..29ea5ba 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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:
diff --git a/audio.c b/audio.c
index 34168ca..c58471b 100644
--- a/audio.c
+++ b/audio.c
@@ -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)