Commit 5cd1cfe2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* modules/demux/util/sub.?

  Vobsub is working now. only track 0 will be played atm.
  spudec scaling will need to be implemented or vobsub is pretty useless.
* modules/codec/spudec
  Changed an error into a warning message.
parent 95595966
......@@ -2,7 +2,7 @@
* parse.c: SPU parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: parse.c,v 1.16 2003/11/24 00:39:01 fenrir Exp $
* $Id: parse.c,v 1.17 2004/01/27 22:51:39 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -283,7 +283,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
((p_sys->buffer[i_index+4]>>4)&0x0f);
p_spu->i_height = (((p_sys->buffer[i_index+4]&0x0f)<<8)|
p_sys->buffer[i_index+5]) - p_spu->i_y + 1;
i_index += 6;
break;
......@@ -297,7 +297,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
break;
default: /* xx (unknown command) */
msg_Err( p_dec, "unknown command 0x%.2x", i_command );
msg_Warn( p_dec, "unknown command 0x%.2x", i_command );
return VLC_EGENERIC;
}
......
......@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spudec.c,v 1.30 2003/11/22 23:39:14 fenrir Exp $
* $Id: spudec.c,v 1.31 2004/01/27 22:51:39 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -222,6 +222,7 @@ static block_t *Reassemble( decoder_t *p_dec, block_t **pp_block )
if( p_sys->i_spu_size <= 0 && ( p_block->i_pts <= 0 || p_block->i_buffer < 4 ) )
{
msg_Dbg( p_dec, "invalid starting packet (size < 4 or pts <=0)" );
msg_Dbg( p_dec, "spu size: %d, i_pts: %d i_buffer: %d", p_sys->i_spu_size, p_block->i_pts, p_block->i_buffer );
block_Release( p_block );
return NULL;
}
......
......@@ -2,7 +2,7 @@
* sub.c: subtitle demux for external subtitle files
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: sub.c,v 1.49 2004/01/27 13:10:29 fenrir Exp $
* $Id: sub.c,v 1.50 2004/01/27 22:51:39 hartman Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org>
......@@ -449,6 +449,7 @@ static int sub_open( subtitle_demux_t *p_sub, input_thread_t *p_input,
/* *** fix subtitle (order and time) *** */
p_sub->i_subtitle = 0; /* will be modified by sub_fix */
if( p_sub->i_sub_type != SUB_TYPE_VOBSUB )
{
sub_fix( p_sub );
......@@ -579,7 +580,7 @@ static int sub_demux( subtitle_demux_t *p_sub, mtime_t i_maxdate )
if( i_size <= 0 ) i_size = 65535; /* Invalid or EOF */
/* Seek at the right place (could be avoid if sub_seek is fixed to do his job) */
if( fseek( p_sub->p_vobsub_file, i_pos, SEEK_CUR ) )
if( fseek( p_sub->p_vobsub_file, i_pos, SEEK_SET ) )
{
msg_Warn( p_sub, "cannot seek at right vobsub location %d", i_pos );
p_sub->i_subtitle++;
......@@ -1171,13 +1172,19 @@ static int DemuxVobSub( subtitle_demux_t *p_demux, block_t *p_bk )
i_spu = i_id&0x1f;
msg_Dbg( p_demux, "SPU track %d size %d", i_spu, i_size );
if( p_demux->p_es )
/* FIXME i_spu == determines which of the spu tracks we will show. */
if( p_demux->p_es && i_spu == 0 )
{
p_pkt->i_pts = p_bk->i_pts;
es_out_Send( p_demux->p_input->p_es_out, p_demux->p_es, p_pkt );
p_bk->i_pts = 0; /* only first packet has a pts */
}
else
{
block_Release( p_pkt );
continue;
}
}
return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment