diff options
| author | phintuka <phintuka> | 2011-10-25 06:36:04 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-10-25 06:36:04 +0000 |
| commit | 46be74f0836ba7cfe0f99e5af4a0cf91ed5c09e6 (patch) | |
| tree | 4dea7ea3da0f6bf4b1e524fa085a589a12693eb7 | |
| parent | e984a0c0371635bda48ac76ea84563d3292320aa (diff) | |
| download | xineliboutput-46be74f0836ba7cfe0f99e5af4a0cf91ed5c09e6.tar.gz xineliboutput-46be74f0836ba7cfe0f99e5af4a0cf91ed5c09e6.tar.bz2 | |
Added mutex for pts
| -rw-r--r-- | xine/xvdr_metronom.c | 17 | ||||
| -rw-r--r-- | xine/xvdr_metronom.h | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/xine/xvdr_metronom.c b/xine/xvdr_metronom.c index 8d230865..7a730f8e 100644 --- a/xine/xvdr_metronom.c +++ b/xine/xvdr_metronom.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xvdr_metronom.c,v 1.12 2011-02-13 14:21:55 phintuka Exp $ + * $Id: xvdr_metronom.c,v 1.13 2011-10-25 06:36:04 phintuka Exp $ * */ @@ -91,8 +91,11 @@ static void set_option(metronom_t *metronom, int option, int64_t value) xvdr_metronom_t *this = (xvdr_metronom_t *)metronom; if (option == XVDR_METRONOM_LAST_VO_PTS) { - if (value > 0) + if (value > 0) { + pthread_mutex_lock(&this->pts_mutex); this->last_vo_pts = value; + pthread_mutex_unlock(&this->pts_mutex); + } return; } @@ -104,7 +107,11 @@ static int64_t get_option(metronom_t *metronom, int option) xvdr_metronom_t *this = (xvdr_metronom_t *)metronom; if (option == XVDR_METRONOM_LAST_VO_PTS) { - return this->last_vo_pts; + int64_t pts; + pthread_mutex_lock(&this->pts_mutex); + pts = this->last_vo_pts; + pthread_mutex_unlock(&this->pts_mutex); + return pts; } if (option == XVDR_METRONOM_TRICK_SPEED) { return this->trickspeed; @@ -204,6 +211,8 @@ static void xvdr_metronom_dispose(xvdr_metronom_t *this) { xvdr_metronom_unwire(this); + pthread_mutex_destroy(&this->pts_mutex); + free(this); } @@ -238,6 +247,8 @@ xvdr_metronom_t *xvdr_metronom_init(xine_stream_t *stream) this->metronom.exit = metronom_exit; + pthread_mutex_init(&this->pts_mutex, NULL); + xvdr_metronom_wire(this); return this; diff --git a/xine/xvdr_metronom.h b/xine/xvdr_metronom.h index 42badd70..e59e37ed 100644 --- a/xine/xvdr_metronom.h +++ b/xine/xvdr_metronom.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xvdr_metronom.h,v 1.7 2011-02-13 14:21:55 phintuka Exp $ + * $Id: xvdr_metronom.h,v 1.8 2011-10-25 06:36:04 phintuka Exp $ * */ @@ -57,6 +57,8 @@ struct xvdr_metronom_s { int still_mode; int64_t last_vo_pts; /* last displayed video frame PTS */ int wired; /* true if currently wired to stream */ + + pthread_mutex_t pts_mutex; #endif }; |
