summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2015-08-24 12:47:27 +0200
committerThomas Reufer <thomas@reufer.ch>2015-08-24 12:47:27 +0200
commitf688182f1a18f8b02cafdffc868d21b13c2779aa (patch)
tree3bf341749421b3fd9a8d3de0de9edba8369e7cdc
parent765f6f50e6516a7ac38c221afc458f9a616d3872 (diff)
downloadvdr-plugin-rpihddevice-f688182f1a18f8b02cafdffc868d21b13c2779aa.tar.gz
vdr-plugin-rpihddevice-f688182f1a18f8b02cafdffc868d21b13c2779aa.tar.bz2
treat zero as valid PTS value also in cRpiAudioDecoder::cParser
-rw-r--r--audio.c18
-rw-r--r--audio.h2
-rw-r--r--omx.c6
-rw-r--r--omx.h4
4 files changed, 15 insertions, 15 deletions
diff --git a/audio.c b/audio.c
index 7c7b460..6a2864a 100644
--- a/audio.c
+++ b/audio.c
@@ -115,9 +115,9 @@ public:
return m_packet.size;
}
- uint64_t GetPts(void)
+ int64_t GetPts(void)
{
- uint64_t pts = 0;
+ int64_t pts = OMX_INVALID_PTS;
m_mutex->Lock();
if (!m_ptsQueue.empty())
@@ -174,7 +174,7 @@ public:
m_mutex->Unlock();
}
- bool Append(const unsigned char *data, uint64_t pts, unsigned int length)
+ bool Append(const unsigned char *data, int64_t pts, unsigned int length)
{
m_mutex->Lock();
bool ret = true;
@@ -219,7 +219,7 @@ public:
// clear current PTS since it's not valid anymore after
// shrinking the packet
if (!retainPts)
- m_ptsQueue.front()->pts = 0;
+ m_ptsQueue.front()->pts = OMX_INVALID_PTS;
m_ptsQueue.front()->length -= length;
length = 0;
@@ -339,10 +339,10 @@ private:
struct Pts
{
- Pts(uint64_t _pts, unsigned int _length)
+ Pts(int64_t _pts, unsigned int _length)
: pts(_pts), length(_length) { };
- uint64_t pts;
+ int64_t pts;
unsigned int length;
};
@@ -893,7 +893,7 @@ public:
delete m_mutex;
}
- int WriteSamples(uint8_t** data, int samples, uint64_t pts,
+ int WriteSamples(uint8_t** data, int samples, int64_t pts,
AVSampleFormat sampleFormat = AV_SAMPLE_FMT_NONE)
{
if (!Ready())
@@ -1134,7 +1134,7 @@ private:
#endif
AVSampleFormat m_pcmSampleFormat;
- uint64_t m_pts;
+ int64_t m_pts;
};
/* ------------------------------------------------------------------------- */
@@ -1244,7 +1244,7 @@ int cRpiAudioDecoder::DeInit(void)
}
bool cRpiAudioDecoder::WriteData(const unsigned char *buf, unsigned int length,
- uint64_t pts)
+ int64_t pts)
{
Lock();
diff --git a/audio.h b/audio.h
index 9560513..8ff2b47 100644
--- a/audio.h
+++ b/audio.h
@@ -26,7 +26,7 @@ public:
virtual int DeInit(void);
virtual bool WriteData(const unsigned char *buf, unsigned int length,
- uint64_t pts = 0);
+ int64_t pts = 0);
virtual bool Poll(void);
virtual void Reset(void);
diff --git a/omx.c b/omx.c
index 1b18f23..1fc2fd9 100644
--- a/omx.c
+++ b/omx.c
@@ -593,7 +593,7 @@ int64_t cOmx::FromOmxTicks(OMX_TICKS &ticks)
return ret;
}
-void cOmx::PtsToTicks(uint64_t pts, OMX_TICKS &ticks)
+void cOmx::PtsToTicks(int64_t pts, OMX_TICKS &ticks)
{
// ticks = pts * OMX_TICKS_PER_SECOND / PTSTICKS
pts = pts * 100 / 9;
@@ -601,10 +601,10 @@ void cOmx::PtsToTicks(uint64_t pts, OMX_TICKS &ticks)
ticks.nHighPart = pts >> 32;
}
-uint64_t cOmx::TicksToPts(OMX_TICKS &ticks)
+int64_t cOmx::TicksToPts(OMX_TICKS &ticks)
{
// pts = ticks * PTSTICKS / OMX_TICKS_PER_SECOND
- uint64_t pts = ticks.nHighPart;
+ int64_t pts = ticks.nHighPart;
pts = (pts << 32) + ticks.nLowPart;
pts = pts * 9 / 100;
return pts;
diff --git a/omx.h b/omx.h
index 17591ea..16237fe 100644
--- a/omx.h
+++ b/omx.h
@@ -35,8 +35,8 @@ public:
static OMX_TICKS ToOmxTicks(int64_t val);
static int64_t FromOmxTicks(OMX_TICKS &ticks);
- static void PtsToTicks(uint64_t pts, OMX_TICKS &ticks);
- static uint64_t TicksToPts(OMX_TICKS &ticks);
+ static void PtsToTicks(int64_t pts, OMX_TICKS &ticks);
+ static int64_t TicksToPts(OMX_TICKS &ticks);
int64_t GetSTC(void);
bool IsClockRunning(void);