From 77ba136d5f5cb3f83156ad45a752e1f503001f65 Mon Sep 17 00:00:00 2001 From: Andreas Heinchen Date: Sun, 4 May 2003 18:01:22 +0000 Subject: fixed subtitles that I broke with the improved seekingpatch CVS patchset: 4768 CVS date: 2003/05/04 18:01:22 --- src/demuxers/demux_ogg.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 87c2dae46..1ab858d95 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.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: demux_ogg.c,v 1.93 2003/05/04 17:29:36 heinchen Exp $ + * $Id: demux_ogg.c,v 1.94 2003/05/04 18:01:22 heinchen Exp $ * * demultiplexer for ogg streams * @@ -479,14 +479,14 @@ static void send_ogg_buf (demux_ogg_t *this, #endif } else { subtitle = (char *)&op->packet[hdrlen + 1]; -#ifdef LOG - printf ("demux_ogg: subtitle %d -> %d :%s\n",start,end,subtitle); -#endif + if ((strlen(subtitle) > 1) || (*subtitle != ' ')) { start = op->granulepos; end = start+lenbytes; - +#ifdef LOG + printf ("demux_ogg: subtitlestream %d: %d -> %d :%s\n",stream_num,start,end,subtitle); +#endif buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = this->buf_types[stream_num]; @@ -1098,7 +1098,10 @@ static void demux_ogg_send_content (demux_ogg_t *this) { /*discard granulepos-less packets and to early audiopackets*/ if (this->resync[stream_num]) { - if ((op.granulepos==-1) && (this->header_granulepos[stream_num]==-1)) { + if ((this->buf_types[stream_num] & 0xFF000000) == BUF_SPU_BASE) { + /*never drop subtitles*/ + this->resync[stream_num]=0; + } else if ((op.granulepos==-1) && (this->header_granulepos[stream_num]==-1)) { continue; } else { -- cgit v1.2.3