]> git.sesse.net Git - vlc/commitdiff
Use the actual pts in qtcapture.
authorDerk-Jan Hartman <hartman@videolan.org>
Wed, 16 Jul 2008 14:58:05 +0000 (16:58 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Wed, 16 Jul 2008 14:58:05 +0000 (16:58 +0200)
This works, but perhaps i'm loosing too much precission here. Are there better ways to change timevalue + scale into walltime ?

modules/access/qtcapture.m

index ab56a299204f0968d6fb66ac412b4a828a2333f7..dd850dc51b2267758859008fd2007980c3ece6a1 100644 (file)
@@ -107,7 +107,7 @@ vlc_module_end();
     {
         imageBufferToRelease = currentImageBuffer;
         currentImageBuffer = videoFrame;
-        currentPts = [sampleBuffer presentationTime].timeValue;
+        currentPts = 1000000L / [sampleBuffer presentationTime].timeScale * [sampleBuffer presentationTime].timeValue;
     }
     CVBufferRelease(imageBufferToRelease);
 }
@@ -356,9 +356,6 @@ static int Demux( demux_t *p_demux )
         return 1;
     }
 
-    /* FIXME */
-    p_block->i_pts = mdate();
-
     es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts );
     es_out_Send( p_demux->out, p_sys->p_es_video, p_block );
 
@@ -390,12 +387,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
            *pi64 = (int64_t)DEFAULT_PTS_DELAY;
            return VLC_SUCCESS;
 
-        case DEMUX_GET_TIME:
-           pi64 = (int64_t*)va_arg( args, int64_t * );
-           *pi64 = mdate();
-           return VLC_SUCCESS;
-
-        /* TODO implement others */
         default:
            return VLC_EGENERIC;
     }