From f81de288d47f6fada66abd8c8f284425e2eb7cf1 Mon Sep 17 00:00:00 2001 From: Rocky Bernstein Date: Fri, 7 Mar 2003 22:19:20 +0000 Subject: =?UTF-8?q?Recognize=20VCD=20and=20CVD=20subtitle=20streams.=20Cha?= =?UTF-8?q?nges=20courtesy=20of=20Julio=20S=C3=A1nchez=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CVS patchset: 4366 CVS date: 2003/03/07 22:19:20 --- src/demuxers/demux_mpeg_block.c | 48 +++++++++++++++++++++++++++++++++++++++-- src/xine-engine/buffer.h | 6 ++++-- 2 files changed, 50 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index a640449d8..0a2b99954 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2002 the xine project + * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a free video player. * @@ -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: demux_mpeg_block.c,v 1.160 2003/02/15 18:27:29 mroi Exp $ + * $Id: demux_mpeg_block.c,v 1.161 2003/03/07 22:19:20 rockyb Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -479,6 +479,50 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m return; } + /* SVCD OGT subtitles in stream 0x70 */ + if(p[0] == 0x70 && (p[1] & 0xFC) == 0x00) { + spu_id = p[1]; + + buf->content = p+1; + buf->size = packet_len-1; + buf->type = BUF_SPU_SVCD + spu_id; + buf->pts = pts; + if( !preview_mode ) + check_newpts( this, pts, PTS_VIDEO ); + + buf->extra_info->input_pos = this->input->get_current_pos(this->input); + buf->extra_info->input_length = this->input->get_length (this->input); + + this->video_fifo->put (this->video_fifo, buf); +#ifdef LOG + printf ("demux_mpeg_block: SPU SVCD PACK (%lld, %d) put on fifo\n", pts, spu_id); +#endif + + return; + } + + /* SVCD CVD subtitles in streams 0x00-0x03 */ + if((p[0] & 0xFC) == 0x00) { + spu_id = (p[0] & 0x03); + + buf->content = p+1; + buf->size = packet_len-1; + buf->type = BUF_SPU_CVD + spu_id; + buf->pts = pts; + if( !preview_mode ) + check_newpts( this, pts, PTS_VIDEO ); + + buf->extra_info->input_pos = this->input->get_current_pos(this->input); + buf->extra_info->input_length = this->input->get_length (this->input); + + this->video_fifo->put (this->video_fifo, buf); +#ifdef LOG + printf ("demux_mpeg_block: SPU CVD PACK (%lld, %d) put on fifo\n", pts, spu_id); +#endif + + return; + } + if ((p[0]&0xF0) == 0x80) { /* printf ( "ac3 PES packet, track %02x\n",track); */ diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 4aeb6d0a1..f7b1897aa 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -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: buffer.h,v 1.102 2003/02/23 19:27:57 tmattern Exp $ + * $Id: buffer.h,v 1.103 2003/03/07 22:19:21 rockyb Exp $ * * * contents: @@ -203,6 +203,8 @@ extern "C" { #define BUF_SPU_TEXT 0x04010000 #define BUF_SPU_CC 0x04020000 #define BUF_SPU_DVB 0x04030000 +#define BUF_SPU_SVCD 0x04040000 +#define BUF_SPU_CVD 0x04050000 /* demuxer block types: */ @@ -436,7 +438,7 @@ struct fifo_buffer_s /* the same as buffer_pool_alloc but may fail if none is available */ buf_element_t *(*buffer_pool_try_alloc) (fifo_buffer_t *this); - /* the samme as put but insert at the head of the fifo */ + /* the same as put but insert at the head of the fifo */ void (*insert) (fifo_buffer_t *fifo, buf_element_t *buf); /* -- cgit v1.2.3