diff options
-rw-r--r-- | xine/vo_lastpts.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/xine/vo_lastpts.c b/xine/vo_lastpts.c index 75f1409b..00d9778f 100644 --- a/xine/vo_lastpts.c +++ b/xine/vo_lastpts.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vo_lastpts.c,v 1.2 2010-01-30 19:26:16 phintuka Exp $ + * $Id: vo_lastpts.c,v 1.3 2011-02-13 14:39:41 phintuka Exp $ * */ @@ -22,7 +22,9 @@ * lastpts_hook_t */ typedef struct { - vo_driver_hook_t h; + vo_driver_hook_t h; + xine_stream_t *prev_stream; + metronom_t *xvdr_metronom; } lastpts_hook_t; /* @@ -37,9 +39,27 @@ static void lastpts_display_frame(vo_driver_t *self, vo_frame_t *vo_img) { lastpts_hook_t *this = (lastpts_hook_t*)self; +#if 0 if (vo_img->stream) { vo_img->stream->metronom->set_option(vo_img->stream->metronom, XVDR_METRONOM_LAST_VO_PTS, vo_img->pts); } +#else + + /* detect intercepted metronom with XVDR_* option support. + * This prevents flooding log with "unknown option in set_option" messages + */ + if (vo_img->stream != this->prev_stream && vo_img->stream) { + this->prev_stream = vo_img->stream; + if (vo_img->stream->metronom->get_option(vo_img->stream->metronom, XVDR_METRONOM_ID) == XVDR_METRONOM_ID) { + this->xvdr_metronom = vo_img->stream->metronom; + } + } + + if (this->xvdr_metronom) { + this->xvdr_metronom->set_option(this->xvdr_metronom, XVDR_METRONOM_LAST_VO_PTS, vo_img->pts); + } + +#endif this->h.orig_driver->display_frame(this->h.orig_driver, vo_img); } |