VLC_ADD_LDFLAGS([macosx], [-Wl,-framework,IOKit])
VLC_ADD_LDFLAGS([macosx], [-Wl,-framework,QuickTime])
VLC_ADD_LDFLAGS([macosx qtcapture], [-Wl,-framework,QTKit])
+ VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,CoreAudio])
VLC_ADD_LDFLAGS([macosx], [-Wl,-framework,WebKit])
VLC_ADD_LDFLAGS([opengllayer qtcapture], [-Wl,-framework,QuartzCore])
VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,CoreVideo])
#include <vlc_interface.h>
#import <QTKit/QTKit.h>
+#import <CoreAudio/CoreAudio.h>
/*****************************************************************************
* Local prototypes
{
imageBufferToRelease = currentImageBuffer;
currentImageBuffer = videoFrame;
- currentPts = 1000000L / [sampleBuffer presentationTime].timeScale * [sampleBuffer presentationTime].timeValue;
+ currentPts = (mtime_t)(1000000L / [sampleBuffer presentationTime].timeScale * [sampleBuffer presentationTime].timeValue);
+
+ /* Try to use hosttime of the sample if available, because iSight Pts seems broken */
+ NSNumber *hosttime = (NSNumber *)[sampleBuffer attributeForKey:QTSampleBufferHostTimeAttribute];
+ if( hosttime ) currentPts = (mtime_t)AudioConvertHostTimeToNanos([hosttime unsignedLongLongValue])/1000;
}
CVBufferRelease(imageBufferToRelease);
}