From ba58f84896a1cf84200fa0aa8ea0936b2a0326d6 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sat, 1 Sep 2012 09:43:15 +0200 Subject: [PATCH] Fix pause handling --- videovpeogl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/videovpeogl.cc b/videovpeogl.cc index b565266..294bc3a 100644 --- a/videovpeogl.cc +++ b/videovpeogl.cc @@ -2747,9 +2747,13 @@ UINT VideoVPEOGL::DeliverMediaPacketOMX(MediaPacket packet, if (!omx_running) return 0; // if we are not runnig do not do this + if (paused) return 0; //Block if we pause - if (packet.synched && packet.presentation_time<0) { - Log::getInstance()->log("Video", Log::DEBUG, "DeliverMediaPacketOMX Preroll %lld", packet.presentation_time); + long long current_media_time=GetCurrentSystemTime()+playbacktimeoffset; + if (packet.synched && + (packet.presentation_time<0 || // preroll skip frames + (packet.presentation_time-1000000LL)>(current_media_time))) { // we are late skip + Log::getInstance()->log("Video", Log::DEBUG, "DeliverMediaPacketOMX Preroll or too late %lld %lld", packet.presentation_time,current_media_time); *samplepos=packet.length; return packet.length; } -- 2.39.5