Thanks for testing - works here too.  Dmitrij, I haven't seen any mails
from you recently, are you still around?

On 2018/06/23 15:35, Hiltjo Posthuma wrote:
> On Sat, Jun 23, 2018 at 01:27:54PM +0100, Stuart Henderson wrote:
> > moved from tech@
> > 
> > I'm not seeing the hang, but I know why it's using gettimeofday, here's a
> > patch to use clock_gettime instead.
> > 
> > OK?
> > 
> > Index: Makefile
> > ===================================================================
> > RCS file: /cvs/ports/multimedia/mpv/Makefile,v
> > retrieving revision 1.39
> > diff -u -p -r1.39 Makefile
> > --- Makefile        20 Jan 2018 11:42:59 -0000      1.39
> > +++ Makefile        23 Jun 2018 12:26:51 -0000
> > @@ -10,7 +10,7 @@ COMMENT =         movie player based on MPlayer
> >  GH_ACCOUNT =               mpv-player
> >  GH_PROJECT =               mpv
> >  GH_TAGNAME =               v0.22.0
> > -REVISION =         1
> > +REVISION =         2
> >  
> >  CATEGORIES =               multimedia x11
> >  
> > Index: patches/patch-osdep_timer-linux_c
> > ===================================================================
> > RCS file: patches/patch-osdep_timer-linux_c
> > diff -N patches/patch-osdep_timer-linux_c
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-osdep_timer-linux_c       23 Jun 2018 12:26:51 -0000
> > @@ -0,0 +1,17 @@
> > +$OpenBSD$
> > +
> > +OpenBSD doesn't define _POSIX_TIMERS because we are missing some of the
> > +required clocks, but we do have enough for mpv.
> > +
> > +Index: osdep/timer-linux.c
> > +--- osdep/timer-linux.c.orig
> > ++++ osdep/timer-linux.c
> > +@@ -19,6 +19,8 @@
> > +  */
> > + 
> > + #include <unistd.h>
> > ++#undef _POSIX_TIMERS
> > ++#define _POSIX_TIMERS 1
> > + #include <stdlib.h>
> > + #include <time.h>
> > + #include <sys/time.h>
> > Index: patches/patch-osdep_timer_c
> > ===================================================================
> > RCS file: patches/patch-osdep_timer_c
> > diff -N patches/patch-osdep_timer_c
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-osdep_timer_c     23 Jun 2018 12:26:51 -0000
> > @@ -0,0 +1,17 @@
> > +$OpenBSD$
> > +
> > +OpenBSD doesn't define _POSIX_TIMERS because we are missing some of the
> > +required clocks, but we do have enough for mpv.
> > +
> > +Index: osdep/timer.c
> > +--- osdep/timer.c.orig
> > ++++ osdep/timer.c
> > +@@ -19,6 +19,8 @@
> > + #include <pthread.h>
> > + #include <time.h>
> > + #include <unistd.h>
> > ++#undef _POSIX_TIMERS
> > ++#define _POSIX_TIMERS 1
> > + #include <sys/time.h>
> > + #include <limits.h>
> > + #include <assert.h>
> > Index: patches/patch-stream_tvi_v4l2_c
> > ===================================================================
> > RCS file: patches/patch-stream_tvi_v4l2_c
> > diff -N patches/patch-stream_tvi_v4l2_c
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-stream_tvi_v4l2_c 23 Jun 2018 12:26:51 -0000
> > @@ -0,0 +1,17 @@
> > +$OpenBSD$
> > +
> > +OpenBSD doesn't define _POSIX_TIMERS because we are missing some of the
> > +required clocks, but we do have enough for mpv.
> > +
> > +Index: stream/tvi_v4l2.c
> > +--- stream/tvi_v4l2.c.orig
> > ++++ stream/tvi_v4l2.c
> > +@@ -44,6 +44,8 @@ known issues:
> > + #include <sys/time.h>
> > + #include <sys/types.h>
> > + #include <unistd.h>
> > ++#undef _POSIX_TIMERS
> > ++#define _POSIX_TIMERS 1
> > + #include <math.h>
> > + #if HAVE_SYS_VIDEOIO_H
> > + #include <sys/videoio.h>
> 
> Hi,
> 
> I tested the patch and built mpv and ran a ktrace. Now it uses clock_gettime.
> 
> Tested on amd64.

Reply via email to