[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l2.c,1.6,1.7
Jindrich Makovicka CVS
henry at mplayerhq.hu
Fri Sep 5 12:36:41 CEST 2003
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv6482
Modified Files:
tvi_v4l2.c
Log Message:
10l - forgotten gettimeofday
Index: tvi_v4l2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l2.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- tvi_v4l2.c 1 Sep 2003 12:10:28 -0000 1.6
+++ tvi_v4l2.c 5 Sep 2003 10:35:00 -0000 1.7
@@ -1547,6 +1547,8 @@
pthread_mutex_lock(&priv->skew_mutex);
if (priv->first_frame == 0) {
// there is no first frame yet (unlikely to happen)
+ gettimeofday(&tv, NULL);
+ priv->audio_start_time = (long long)1e6*tv.tv_sec + tv.tv_usec;
// fprintf(stderr, "warning - first frame not yet available!\n");
pthread_mutex_unlock(&priv->skew_mutex);
continue;
@@ -1593,7 +1595,6 @@
// now finally, priv->audio_skew contains fairly good approximation
// of the current value
-// fprintf(stderr, "audio_skew = %lf, delta = %lf\n", (double)priv->audio_skew/1e6, (double)priv->audio_skew_delta_total/1e6);
// current skew factor (assuming linearity)
// used for further interpolation in video_grabber
// probably overkill but seems to be necessary for
@@ -1610,6 +1611,8 @@
prev_skew = priv->audio_skew;
priv->audio_skew -= priv->audio_start_time - priv->first_frame;
pthread_mutex_unlock(&priv->skew_mutex);
+
+// fprintf(stderr, "audio_skew = %lf, delta = %lf\n", (double)priv->audio_skew/1e6, (double)priv->audio_skew_delta_total/1e6);
if ((priv->audio_tail+1) % priv->audio_buffer_size == priv->audio_head) {
mp_msg(MSGT_TV, MSGL_ERR, "\ntoo bad - dropping audio frame !\n");
More information about the MPlayer-cvslog
mailing list