Commit 414b3c3b authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Added a "demuxed-id3" variable to input.c so id3tags won't be parsed

  multiple times anymore.
parent 6fc5b53e
......@@ -2,7 +2,7 @@
* id3tag.c: id3 tag parser/skipper based on libid3tag
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: id3tag.c,v 1.10 2003/10/18 22:48:25 hartman Exp $
* $Id: id3tag.c,v 1.11 2003/10/20 00:01:06 hartman Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -129,6 +129,7 @@ static void ParseID3Tag( input_thread_t *p_input, u8 *p_data, int i_size )
static int ParseID3Tags( vlc_object_t *p_this )
{
input_thread_t *p_input;
vlc_value_t val;
u8 *p_peek;
int i_size;
int i_size2;
......@@ -139,7 +140,17 @@ static int ParseID3Tags( vlc_object_t *p_this )
}
p_input = (input_thread_t *)p_this;
msg_Dbg( p_input, "Checking for ID3 tag" );
var_Get( p_input, "demuxed-id3", &val );
if( val.b_bool )
{
msg_Dbg( p_input, "The ID3 tag was already parsed" );
return VLC_EGENERIC;
}
else
{
msg_Dbg( p_input, "Checking for ID3 tag" );
}
if ( p_input->stream.b_seekable &&
p_input->stream.i_method != INPUT_METHOD_NETWORK )
......@@ -205,6 +216,8 @@ static int ParseID3Tags( vlc_object_t *p_this )
i_size = id3_tag_query( p_peek, 10 );
if ( i_size <= 0 )
{
val.b_bool = VLC_TRUE;
var_Change( p_input, "demuxed-id3", VLC_VAR_SETVALUE, &val, NULL );
return( VLC_SUCCESS );
}
......@@ -218,5 +231,8 @@ static int ParseID3Tags( vlc_object_t *p_this )
ParseID3Tag( p_input, p_peek, i_size );
msg_Dbg( p_input, "ID3 tag found, skiping %d bytes", i_size );
p_input->p_current_data += i_size; /* seek passed end of ID3 tag */
val.b_bool = VLC_TRUE;
var_Change( p_input, "demuxed-id3", VLC_VAR_SETVALUE, &val, NULL );
return( VLC_SUCCESS );
}
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.247 2003/10/11 22:40:05 hartman Exp $
* $Id: input.c,v 1.248 2003/10/20 00:01:06 hartman Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -156,6 +156,10 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "state", StateCallback, NULL );
/* state variable */
var_Create( p_input, "demuxed-id3", VLC_VAR_BOOL );
val.b_bool = VLC_FALSE;
var_Change( p_input, "demuxed-id3", VLC_VAR_SETVALUE, &val, NULL );
/* Initialize thread properties */
p_input->b_eof = 0;
......
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