diff options
author | phintuka <phintuka> | 2012-03-22 12:03:37 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2012-03-22 12:03:37 +0000 |
commit | acaa556e394a33886e5593e58c88118822713aef (patch) | |
tree | 7825aae908c46bf13cb7208c7f7f51984e72b40b | |
parent | 7e05e8b4d5cf8d4d6f84c3ecf98a2da635e6fa5a (diff) | |
download | xineliboutput-acaa556e394a33886e5593e58c88118822713aef.tar.gz xineliboutput-acaa556e394a33886e5593e58c88118822713aef.tar.bz2 |
Feed incoming PCR values to SCR
-rw-r--r-- | xine/adjustable_scr.c | 14 | ||||
-rw-r--r-- | xine/adjustable_scr.h | 3 | ||||
-rw-r--r-- | xine_input_vdr.c | 26 |
3 files changed, 39 insertions, 4 deletions
diff --git a/xine/adjustable_scr.c b/xine/adjustable_scr.c index a06f59d7..bda454c4 100644 --- a/xine/adjustable_scr.c +++ b/xine/adjustable_scr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: adjustable_scr.c,v 1.4 2012-03-22 11:30:02 phintuka Exp $ + * $Id: adjustable_scr.c,v 1.5 2012-03-22 12:03:37 phintuka Exp $ * */ @@ -250,7 +250,18 @@ static void adjustable_scr_jump (adjustable_scr_t *scr, int pts) } /* + * got_pcr() * + * - Synchronize clock to incoming PCR values + */ +static void adjustable_scr_got_pcr (adjustable_scr_t *scr, int64_t pcr) +{ +} + +/* + * set_buffering() + * + * - Clock is freezed while buffering */ static void adjustable_scr_set_buffering (adjustable_scr_t *scr, int buffering) { @@ -317,6 +328,7 @@ adjustable_scr_t* adjustable_scr_start (xine_t *xine) this->ascr.set_speed_tuning = adjustable_scr_speed_tuning; this->ascr.set_speed_base = adjustable_scr_speed_base; this->ascr.jump = adjustable_scr_jump; + this->ascr.got_pcr = adjustable_scr_got_pcr; this->ascr.set_buffering = adjustable_scr_set_buffering; this->ascr.dispose = adjustable_scr_dispose; diff --git a/xine/adjustable_scr.h b/xine/adjustable_scr.h index 64e448cb..bbd19171 100644 --- a/xine/adjustable_scr.h +++ b/xine/adjustable_scr.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: adjustable_scr.h,v 1.2 2012-03-22 11:30:02 phintuka Exp $ + * $Id: adjustable_scr.h,v 1.3 2012-03-22 12:03:37 phintuka Exp $ * */ @@ -29,6 +29,7 @@ struct adjustable_scr_s { void (*jump) (adjustable_scr_t *this, int pts); void (*set_buffering) (adjustable_scr_t *this, int on); + void (*got_pcr) (adjustable_scr_t *this, int64_t pcr); void (*dispose) (adjustable_scr_t *this); }; diff --git a/xine_input_vdr.c b/xine_input_vdr.c index ba07650d..12dc71db 100644 --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.357 2012-03-22 11:30:01 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.358 2012-03-22 12:03:37 phintuka Exp $ * */ @@ -136,7 +136,7 @@ typedef struct { # include <linux/unistd.h> /* syscall(__NR_gettid) */ #endif -static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.357 2012-03-22 11:30:01 phintuka Exp $"; +static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.358 2012-03-22 12:03:37 phintuka Exp $"; static const char log_module_input_vdr[] = "[input_vdr] "; #define LOG_MODULENAME log_module_input_vdr #define SysLogLevel iSysLogLevel @@ -4810,6 +4810,28 @@ static buf_element_t *preprocess_buf(vdr_input_plugin_t *this, buf_element_t *bu pthread_mutex_unlock (&this->stream->first_frame_lock); memset(&this->scr_buf, 0, sizeof(this->scr_buf)); + + this->scr->got_pcr(this->scr, -1); + } + + /* live mode clock sync input */ + if (this->live_mode || (this->fd_control >= 0 && !this->fixed_scr)) { + int64_t pcr = -1; + + if (DATA_IS_TS(buf->content) && + ts_get_pcr_n(buf->content, buf->size / TS_SIZE, &pcr) && + pcr >= 0) { + + this->scr->got_pcr(this->scr, pcr); + } + + /* PES stream has no PCR, use audio pts for vdr-1.6.0 compability */ + if (IS_AUDIO_PACKET(buf->content)) { + pcr = pes_get_pts(buf->content, buf->size); + if (pcr > 0) { + this->scr->got_pcr(this->scr, pcr); + } + } } pthread_mutex_unlock(&this->lock); |