diff options
| author | phintuka <phintuka> | 2011-10-25 07:19:29 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-10-25 07:19:29 +0000 |
| commit | 0c0034c446d7e716f1296c1bfa89e184b92bd89e (patch) | |
| tree | 9bdd82f53404c555601ededd79c49fba129a4420 | |
| parent | ba1d4a1ebd4284b9a214242c746931dc91967f7c (diff) | |
| download | xineliboutput-0c0034c446d7e716f1296c1bfa89e184b92bd89e.tar.gz xineliboutput-0c0034c446d7e716f1296c1bfa89e184b92bd89e.tar.bz2 | |
vo_lastpts: added sanity checks and logging
| -rw-r--r-- | xine/vo_lastpts.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/xine/vo_lastpts.c b/xine/vo_lastpts.c index 00d9778f..c7a2d40e 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.3 2011-02-13 14:39:41 phintuka Exp $ + * $Id: vo_lastpts.c,v 1.4 2011-10-25 07:19:29 phintuka Exp $ * */ @@ -18,12 +18,17 @@ #include "vo_hook.h" +#define LOG_MODULENAME "[lastpts ] " +#include "../logdefs.h" + + /* * lastpts_hook_t */ typedef struct { vo_driver_hook_t h; xine_stream_t *prev_stream; + xine_stream_t *xvdr_stream; metronom_t *xvdr_metronom; } lastpts_hook_t; @@ -39,27 +44,35 @@ 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 + ASSERT_RET(self, return); + ASSERT_RET(vo_img, return); /* 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) { + if (vo_img->stream != this->prev_stream && vo_img->stream && vo_img->stream != XINE_ANON_STREAM) { + LOGMSG("stream changed from %p to %p", 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) { + LOGMSG("new stream is vdr stream"); this->xvdr_metronom = vo_img->stream->metronom; + this->xvdr_stream = vo_img->stream; } } if (this->xvdr_metronom) { - this->xvdr_metronom->set_option(this->xvdr_metronom, XVDR_METRONOM_LAST_VO_PTS, vo_img->pts); - } -#endif + if (vo_img->stream == this->xvdr_stream) { + LOGVERBOSE("last pts %"PRId64, vo_img->pts); + ASSERT_RET(this->xvdr_metronom->set_option, return); + + this->xvdr_metronom->set_option(this->xvdr_metronom, XVDR_METRONOM_LAST_VO_PTS, vo_img->pts); + + } else { + LOGVERBOSE("last pts %"PRId64" - %p not vdr stream", vo_img->pts, vo_img->stream); + } + } this->h.orig_driver->display_frame(this->h.orig_driver, vo_img); } |
