Commit 79e27cb3 authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/modules.c, modules/gui/wxwindows/timer.cpp: fixed 2 nasty bugs.

* modules/demux/util/id3tag.c: small cleanup.
parent 6ccfada5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* id3tag.c: id3 tag parser/skipper based on libid3tag * id3tag.c: id3 tag parser/skipper based on libid3tag
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: id3tag.c,v 1.8 2003/06/15 15:16:14 sigmunau Exp $ * $Id: id3tag.c,v 1.9 2003/06/23 16:09:13 gbazin Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -109,7 +109,6 @@ static int ParseID3Tags( vlc_object_t *p_this ) ...@@ -109,7 +109,6 @@ static int ParseID3Tags( vlc_object_t *p_this )
u8 *p_peek; u8 *p_peek;
int i_size; int i_size;
int i_size2; int i_size2;
stream_position_t * p_pos;
if ( p_this->i_object_type != VLC_OBJECT_INPUT ) if ( p_this->i_object_type != VLC_OBJECT_INPUT )
{ {
...@@ -122,17 +121,14 @@ static int ParseID3Tags( vlc_object_t *p_this ) ...@@ -122,17 +121,14 @@ static int ParseID3Tags( vlc_object_t *p_this )
if ( p_input->stream.b_seekable && if ( p_input->stream.b_seekable &&
p_input->stream.i_method != INPUT_METHOD_NETWORK ) p_input->stream.i_method != INPUT_METHOD_NETWORK )
{ {
stream_position_t pos;
/*look for a id3v1 tag at the end of the file*/ /*look for a id3v1 tag at the end of the file*/
p_pos = malloc( sizeof( stream_position_t ) ); input_Tell( p_input, &pos );
if ( p_pos == 0 ) if ( pos.i_size >128 )
{
msg_Err( p_input, "no mem" );
}
input_Tell( p_input, p_pos );
if ( p_pos->i_size >128 )
{ {
input_AccessReinit( p_input ); input_AccessReinit( p_input );
p_input->pf_seek( p_input, p_pos->i_size - 128 ); p_input->pf_seek( p_input, pos.i_size - 128 );
/* get 10 byte id3 header */ /* get 10 byte id3 header */
if( input_Peek( p_input, &p_peek, 10 ) < 10 ) if( input_Peek( p_input, &p_peek, 10 ) < 10 )
...@@ -160,10 +156,10 @@ static int ParseID3Tags( vlc_object_t *p_this ) ...@@ -160,10 +156,10 @@ static int ParseID3Tags( vlc_object_t *p_this )
return( VLC_EGENERIC ); return( VLC_EGENERIC );
} }
i_size2 = id3_tag_query( p_peek + 118, 10 ); i_size2 = id3_tag_query( p_peek + 118, 10 );
if ( i_size2 < 0 && p_pos->i_size > -i_size2 ) if ( i_size2 < 0 && pos.i_size > -i_size2 )
{ /* id3v2.4 footer found */ { /* id3v2.4 footer found */
input_AccessReinit( p_input ); input_AccessReinit( p_input );
p_input->pf_seek( p_input, p_pos->i_size + i_size2 ); p_input->pf_seek( p_input, pos.i_size + i_size2 );
/* peek the entire tag */ /* peek the entire tag */
if ( input_Peek( p_input, &p_peek, i_size2 ) < i_size2 ) if ( input_Peek( p_input, &p_peek, i_size2 ) < i_size2 )
{ {
...@@ -173,7 +169,6 @@ static int ParseID3Tags( vlc_object_t *p_this ) ...@@ -173,7 +169,6 @@ static int ParseID3Tags( vlc_object_t *p_this )
ParseID3Tag( p_input, p_peek, i_size2 ); ParseID3Tag( p_input, p_peek, i_size2 );
} }
} }
free( p_pos );
input_AccessReinit( p_input ); input_AccessReinit( p_input );
p_input->pf_seek( p_input, 0 ); p_input->pf_seek( p_input, 0 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc * timer.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.24 2003/06/13 15:54:42 gbazin Exp $ * $Id: timer.cpp,v 1.25 2003/06/23 16:09:13 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -154,11 +154,9 @@ void Timer::Notify() ...@@ -154,11 +154,9 @@ void Timer::Notify()
wxString::Format((wxString)wxU(_("Volume")) + wxT(" %d"), wxString::Format((wxString)wxU(_("Volume")) + wxT(" %d"),
i_volume * 200 / AOUT_VOLUME_MAX ) ); i_volume * 200 / AOUT_VOLUME_MAX ) );
/* control buttons for free pace streams */
b_pace_control = p_intf->p_sys->p_input->stream.b_pace_control;
} }
/* control buttons for free pace streams */
b_pace_control = p_intf->p_sys->p_input->stream.b_pace_control;
} }
else if( p_intf->p_sys->p_input->b_dead ) else if( p_intf->p_sys->p_input->b_dead )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.c : Builtin and plugin modules management functions * modules.c : Builtin and plugin modules management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.120 2003/05/20 16:20:33 zorglub Exp $ * $Id: modules.c,v 1.121 2003/06/23 16:09:13 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com> * Ethan C. Baldridge <BaldridgeE@cadmus.com>
...@@ -650,7 +650,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this ) ...@@ -650,7 +650,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
} }
/* Free plugin-path */ /* Free plugin-path */
free( path[ sizeof(path)/sizeof(char*) - 2 ] ); if( path[ sizeof(path)/sizeof(char*) - 2 ] )
free( path[ sizeof(path)/sizeof(char*) - 2 ] );
path[ sizeof(path)/sizeof(char*) - 2 ] = NULL; path[ sizeof(path)/sizeof(char*) - 2 ] = NULL;
} }
......
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