diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-03-11 12:31:24 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-03-11 12:31:24 +0000 |
commit | face806c1ee187c1efbaa88313c955b9947948db (patch) | |
tree | 974813b717201ac54afa760bac32a69f1a42addc /src/libspucc | |
parent | 36a843032b4e28aa294ce0795fd96d76c57e3304 (diff) | |
download | xine-lib-face806c1ee187c1efbaa88313c955b9947948db.tar.gz xine-lib-face806c1ee187c1efbaa88313c955b9947948db.tar.bz2 |
metronom and demuxers should work again (although not all demuxers are fully updated at this point). demux_qt can handle compressed audio, but is still unfinished.
Yes, this _is_ the big metronom update, metronom now depends on disc_off information in discontinuities.
CVS patchset: 1554
CVS date: 2002/03/11 12:31:24
Diffstat (limited to 'src/libspucc')
-rw-r--r-- | src/libspucc/cc_decoder.c | 26 | ||||
-rw-r--r-- | src/libspucc/cc_decoder.h | 5 | ||||
-rw-r--r-- | src/libspucc/xine_decoder.c | 9 |
3 files changed, 19 insertions, 21 deletions
diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c index 13230a8a2..d902a38fb 100644 --- a/src/libspucc/cc_decoder.c +++ b/src/libspucc/cc_decoder.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: cc_decoder.c,v 1.6 2002/01/08 20:38:05 cvogler Exp $ + * $Id: cc_decoder.c,v 1.7 2002/03/11 12:31:26 guenter Exp $ * * stuff needed to provide closed captioning decoding and display * @@ -315,8 +315,7 @@ struct cc_decoder_s { uint32_t lastcode; /* The PTS and SCR at which the captioning chunk started */ - uint32_t pts; - uint32_t scr; + int64_t pts; /* holds the NTSC frame offset to last known pts/scr */ uint32_t f_offset; @@ -757,11 +756,11 @@ static void ccmem_exit(cc_memory_t *this) /*----------------- cc_renderer_t methods -------------------------------*/ -static uint32_t cc_renderer_calc_vpts(cc_renderer_t *this, uint32_t pts, - uint32_t scr, uint32_t ntsc_frame_offset) +static uint32_t cc_renderer_calc_vpts(cc_renderer_t *this, int64_t pts, + uint32_t ntsc_frame_offset) { metronom_t *metronom = this->metronom; - uint32_t vpts = metronom->got_spu_packet(metronom, pts, 0, scr); + uint32_t vpts = metronom->got_spu_packet(metronom, pts, 0); return vpts + ntsc_frame_offset * NTSC_FRAME_DURATION; } @@ -773,7 +772,7 @@ static int cc_renderer_on_display(cc_renderer_t *this) } -static void cc_renderer_hide_caption(cc_renderer_t *this, uint32_t vpts) +static void cc_renderer_hide_caption(cc_renderer_t *this, int64_t vpts) { if (this->displayed) { this->osd_renderer->hide(this->cap_display, vpts); @@ -783,7 +782,7 @@ static void cc_renderer_hide_caption(cc_renderer_t *this, uint32_t vpts) static void cc_renderer_show_caption(cc_renderer_t *this, cc_buffer_t *buf, - uint32_t vpts) + int64_t vpts) { #ifdef LOG_DEBUG printf("spucc: cc_renderer: show\n"); @@ -960,8 +959,8 @@ static void cc_hide_displayed(cc_decoder_t *this) #endif if (cc_renderer_on_display(this->cc_cfg->renderer)) { - uint32_t vpts = cc_renderer_calc_vpts(this->cc_cfg->renderer, this->pts, - this->scr, this->f_offset); + int64_t vpts = cc_renderer_calc_vpts(this->cc_cfg->renderer, this->pts, + this->f_offset); cc_renderer_hide_caption(this->cc_cfg->renderer, vpts); } } @@ -975,7 +974,7 @@ static void cc_show_displayed(cc_decoder_t *this) if (cc_onscreen_displayable(this)) { uint32_t vpts = cc_renderer_calc_vpts(this->cc_cfg->renderer, this->pts, - this->scr, this->f_offset); + this->f_offset); #ifdef LOG_DEBUG printf("cc_decoder: cc_show_displayed: showing caption %u at vpts %u\n", this->capid, vpts); #endif @@ -1231,7 +1230,7 @@ static void cc_decode_EIA608(cc_decoder_t *this, uint16_t data) void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, - uint32_t pts, uint32_t scr) + int64_t pts) { /* The first number may denote a channel number. I don't have the * EIA-708 standard, so it is hard to say. @@ -1259,7 +1258,6 @@ void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, this->f_offset = 0; this->pts = pts; - this->scr = scr; while (curbytes < buf_len) { cc_code = *current++; @@ -1324,7 +1322,7 @@ cc_decoder_t *cc_decoder_open(cc_config_t *cc_cfg) this->lastcode = 0; this->capid = 0; - this->pts = this->scr = this->f_offset = 0; + this->pts = this->f_offset = 0; #ifdef LOG_DEBUG printf("spucc: cc_decoder_open\n"); diff --git a/src/libspucc/cc_decoder.h b/src/libspucc/cc_decoder.h index b054d8bd4..c741caff7 100644 --- a/src/libspucc/cc_decoder.h +++ b/src/libspucc/cc_decoder.h @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: cc_decoder.h,v 1.3 2002/01/07 23:04:26 cvogler Exp $ + * $Id: cc_decoder.h,v 1.4 2002/03/11 12:31:26 guenter Exp $ * * stuff needed to provide closed captioning decoding and display * @@ -56,7 +56,7 @@ void cc_decoder_close(cc_decoder_t *this_obj); void cc_decoder_init(void); void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, - uint32_t pts, uint32_t scr); + int64_t pts); /* Instantiates a new closed captioning renderer. */ cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer, @@ -69,3 +69,4 @@ void cc_renderer_close(cc_renderer_t *this_obj); /* Updates the renderer configuration variables */ void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width, int video_height); + diff --git a/src/libspucc/xine_decoder.c b/src/libspucc/xine_decoder.c index cfde5387b..e0db0f2bf 100644 --- a/src/libspucc/xine_decoder.c +++ b/src/libspucc/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.4 2002/02/09 07:13:23 guenter Exp $ + * $Id: xine_decoder.c,v 1.5 2002/03/11 12:31:26 guenter Exp $ * * closed caption spu decoder. receive data by events. * @@ -267,7 +267,7 @@ static void spudec_init (spu_decoder_t *this_gen, vo_instance_t *vo_out) { static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { spucc_decoder_t *this = (spucc_decoder_t *) this_gen; - if (buf->decoder_info[0] == 0) { + if (buf->decoder_flags & BUF_FLAG_PREVIEW) { } else { pthread_mutex_lock(&this->cc_mutex); if (this->cc_cfg.cc_enabled) { @@ -276,7 +276,7 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { if(this->cc_cfg.can_cc) { decode_cc(this->ccdec, buf->content, buf->size, - buf->pts, buf->scr); + buf->pts); } } pthread_mutex_unlock(&this->cc_mutex); @@ -321,8 +321,7 @@ static void spudec_event_listener(void *this_gen, xine_event_t *event_gen) { spucc_do_init (this, NULL); if (this->cc_cfg.can_cc) { decode_cc(this->ccdec, closed_caption->buffer, - closed_caption->buf_len, closed_caption->pts, - closed_caption->scr); + closed_caption->buf_len, closed_caption->pts); } } pthread_mutex_unlock(&this->cc_mutex); |