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;
}