summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--omxdevice.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/omxdevice.c b/omxdevice.c
index 8553781..8cdf8c0 100644
--- a/omxdevice.c
+++ b/omxdevice.c
@@ -308,6 +308,10 @@ int cOmxDevice::PlayAudio(const uchar *Data, int Length, uchar Id)
int cOmxDevice::PlayVideo(const uchar *Data, int Length, bool EndOfFrame)
{
+ // prevent writing incomplete frames
+ if (m_hasVideo && !m_omx->PollVideo())
+ return 0;
+
m_mutex->Lock();
int ret = Length;
int64_t pts = PesHasPts(Data) ? PesGetPts(Data) : 0;