]> git.vomp.tv Git - vompclient.git/commitdiff
Enhanced lipsync
authorMarten Richter <marten.richter@freenet.de>
Sun, 9 Sep 2012 10:12:01 +0000 (12:12 +0200)
committerMarten Richter <marten.richter@freenet.de>
Sun, 9 Sep 2012 10:12:01 +0000 (12:12 +0200)
videoomx.cc

index 57e2e6cb7d6317c26c882b095e0265e4bcfc6289..e1014e51d14666cacae84ca0640cec8b5f181cc2 100644 (file)
@@ -1665,11 +1665,11 @@ bool VideoOMX::FrameSkip(long long pts)
        // we have to wait untile the next frame
        long long offset=Demuxer::getInstance()->getFrameRate();
        if (offset==0) offset=25;
-       offset=10000000LL/offset;
+       offset=-2*10000000LL/offset;
        target_time+=offset;
        long long current_time=GetCurrentSystemTime();
        if (!skipping) {
-               if ((target_time-current_time)<-1000000LL) {
+               if ((target_time-current_time)<-400000LL) {
                        skip=true; // we are too slow
                        skipping=true;
                /*      Log::getInstance()->log("Video", Log::DEBUG,
@@ -1680,7 +1680,7 @@ bool VideoOMX::FrameSkip(long long pts)
                        skipping=false;
                }
        } else {
-               if ((target_time - current_time) < 0LL) {
+               if ((target_time - current_time) < 0000LL) { //skip a bit more
                        skip = true; // we are too slow
                        skipping = true;
                /*      Log::getInstance()->log("Video", Log::DEBUG,"Skipping frames2 %lld %lld",target_time-current_time,pts);
@@ -1703,7 +1703,7 @@ void VideoOMX::FrameWaitforDisplay(long long pts)
        long long offset=Demuxer::getInstance()->getFrameRate();
        long long current_time=GetCurrentSystemTime();
        if (offset==0) offset=25;
-       offset=10000000LL/offset;
+       offset=-2*10000000LL/offset;
        target_time+=offset;
        if ((target_time-current_time)>1000000LL) target_time=current_time+1000000LL; // something is wrong do not wait too long
        //Log::getInstance()->log("Video", Log::DEBUG, "Wait for display pts: %lld target: %lld sys: %lld off: %lld diff %lld",pts,target_time,current_time,offset,