[Xineliboutput-cvslog] vdr-xineliboutput/xine vo_lastpts.c, 1.3, 1.4
Brought to you by:
phintuka
From: Petri H. <phi...@us...> - 2011-10-25 07:19:31
|
Update of /cvsroot/xineliboutput/vdr-xineliboutput/xine In directory vz-cvs-3.sog:/tmp/cvs-serv20208/xine Modified Files: vo_lastpts.c Log Message: vo_lastpts: added sanity checks and logging Index: vo_lastpts.c =================================================================== RCS file: /cvsroot/xineliboutput/vdr-xineliboutput/xine/vo_lastpts.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- vo_lastpts.c 13 Feb 2011 14:39:41 -0000 1.3 +++ vo_lastpts.c 25 Oct 2011 07:19:29 -0000 1.4 @@ -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 @@ { 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); } |