diff options
Diffstat (limited to 'xine')
-rw-r--r-- | xine/vo_lastpts.c | 20 | ||||
-rw-r--r-- | xine/xvdr_metronom.c | 14 | ||||
-rw-r--r-- | xine/xvdr_metronom.h | 10 |
3 files changed, 28 insertions, 16 deletions
diff --git a/xine/vo_lastpts.c b/xine/vo_lastpts.c index 0acdf95e..75f1409b 100644 --- a/xine/vo_lastpts.c +++ b/xine/vo_lastpts.c @@ -4,13 +4,17 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vo_lastpts.c,v 1.1 2010-01-26 11:36:21 phintuka Exp $ + * $Id: vo_lastpts.c,v 1.2 2010-01-30 19:26:16 phintuka Exp $ * */ #include <stdlib.h> +#include <xine/xine_internal.h> #include <xine/video_out.h> +#include <xine/metronom.h> + +#include "xvdr_metronom.h" #include "vo_hook.h" @@ -19,17 +23,8 @@ */ typedef struct { vo_driver_hook_t h; - - /* PTS of last displayed video frame */ - int64_t last_pts; - } lastpts_hook_t; - -/* next symbol is dynamically linked from input plugin */ -int64_t vo_last_video_pts __attribute__((visibility("default"))) = INT64_C(-1); - - /* * interface */ @@ -42,8 +37,9 @@ static void lastpts_display_frame(vo_driver_t *self, vo_frame_t *vo_img) { lastpts_hook_t *this = (lastpts_hook_t*)self; - if (vo_img->pts > 0) - vo_last_video_pts = vo_img->pts; + if (vo_img->stream) { + vo_img->stream->metronom->set_option(vo_img->stream->metronom, XVDR_METRONOM_LAST_VO_PTS, vo_img->pts); + } this->h.orig_driver->display_frame(this->h.orig_driver, vo_img); } diff --git a/xine/xvdr_metronom.c b/xine/xvdr_metronom.c index 4245ee23..441170a7 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.3 2010-01-26 11:46:33 phintuka Exp $ + * $Id: xvdr_metronom.c,v 1.4 2010-01-30 19:26:15 phintuka Exp $ * */ @@ -84,12 +84,24 @@ static void set_audio_rate(metronom_t *metronom, int64_t pts_per_smpls) 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) + this->last_vo_pts = value; + return; + } + this->orig_metronom->set_option(this->orig_metronom, option, value); } 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; + } + return this->orig_metronom->get_option(this->orig_metronom, option); } diff --git a/xine/xvdr_metronom.h b/xine/xvdr_metronom.h index b7aea5ae..b73f8580 100644 --- a/xine/xvdr_metronom.h +++ b/xine/xvdr_metronom.h @@ -4,13 +4,17 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xvdr_metronom.h,v 1.2 2010-01-17 23:03:25 phintuka Exp $ + * $Id: xvdr_metronom.h,v 1.3 2010-01-30 19:26:16 phintuka Exp $ * */ #ifndef XVDR_METRONOM_H #define XVDR_METRONOM_H + +#define XVDR_METRONOM_LAST_VO_PTS 0x1001 + + typedef struct xvdr_metronom_s xvdr_metronom_t; struct xvdr_metronom_s { @@ -42,8 +46,8 @@ struct xvdr_metronom_s { void *handle; void (*frame_decoded)(void *handle, uint video_count, uint audio_count); - /* current trick speed */ - int trickspeed; + int trickspeed; /* current trick speed */ + int64_t last_vo_pts; /* last displayed video frame PTS */ #endif }; |