Changeset 06e5daea61f283d5608de17742ed373a2e407b30

Show
Ignore:
Timestamp:
16/07/08 17:14:22 (5 months ago)
Author:
Derk-Jan Hartman <hartman@videolan.org>
git-committer:
Derk-Jan Hartman <hartman@videolan.org> 1216221262 +0200
git-parent:

[c375cdfc27be5adb35008d91630a0702f986cf53]

git-author:
Derk-Jan Hartman <hartman@videolan.org> 1216221262 +0200
Message:

Don't send blocks from qtcapture Demux that we have already sent before. Avoid excessive CPU usage while there are no new blocks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/qtcapture.m

    rc375cdf r06e5dae  
    6969    CVImageBufferRef currentImageBuffer; 
    7070    mtime_t currentPts; 
     71    mtime_t previousPts; 
    7172} 
    7273- (id)init; 
     
    8384        currentImageBuffer = nil; 
    8485        currentPts = 0; 
     86        previousPts = 0; 
    8587    } 
    8688    return self; 
     
    118120    mtime_t pts; 
    119121 
    120     if(!currentImageBuffer
     122    if(!currentImageBuffer || currentPts == previousPts
    121123        return 0; 
    122124 
     
    124126    { 
    125127        imageBuffer = CVBufferRetain(currentImageBuffer); 
    126         pts = currentPts; 
     128        pts = previousPts = currentPts; 
    127129 
    128130        CVPixelBufferLockBaseAddress(imageBuffer, 0); 
     
    354356        block_Release( p_block ); 
    355357        [pool release]; 
     358        msleep( 10000 ); 
    356359        return 1; 
    357360    }