From: Derk-Jan Hartman Date: Sun, 19 Oct 2003 13:39:12 +0000 (+0000) Subject: * modules/demux/avi/* X-Git-Tag: 0.7.0~778 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=898575aa36be19b77958da222f9445c1e2e4b3b3;p=vlc * modules/demux/avi/* - print a debug message in case of 0xfffe audio This is either a WAVEFORMATEXTENSIBLE or encapsulated vorbis audio - use c-style comments * modules/gui/macosx/info.m: - release your objects when you finished using them. --- diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c index aa07b8bfcb..251abf2e49 100644 --- a/modules/demux/avi/avi.c +++ b/modules/demux/avi/avi.c @@ -2,7 +2,7 @@ * avi.c : AVI file Stream input module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: avi.c,v 1.62 2003/09/13 17:42:15 fenrir Exp $ + * $Id: avi.c,v 1.63 2003/10/19 13:39:11 hartman Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -576,9 +576,9 @@ typedef struct avi_stream_toread_s int i_toread; - off_t i_posf; // where we will read : - // if i_idxposb == 0 : begining of chunk (+8 to acces data) - // else : point on data directly + off_t i_posf; /* where we will read : + if i_idxposb == 0 : begining of chunk (+8 to acces data) + else : point on data directly */ } avi_stream_toread_t; static int Demux_Seekable( input_thread_t *p_input ) @@ -588,7 +588,7 @@ static int Demux_Seekable( input_thread_t *p_input ) vlc_bool_t b_stream; vlc_bool_t b_play_audio; vlc_bool_t b_video; /* is there some video track selected */ - // cannot be more than 100 stream (dcXX or wbXX) + /* cannot be more than 100 stream (dcXX or wbXX) */ avi_stream_toread_t toread[100]; demux_sys_t *p_avi = p_input->p_demux_data; @@ -707,7 +707,7 @@ static int Demux_Seekable( input_thread_t *p_input ) if( toread[i].i_toread > 0 ) { - b_done = VLC_FALSE; // not yet finished + b_done = VLC_FALSE; /* not yet finished */ } if( toread[i].i_posf > 0 ) @@ -722,7 +722,7 @@ static int Demux_Seekable( input_thread_t *p_input ) if( b_done ) { -// return( b_stream ? 1 : 0 ); +/* return( b_stream ? 1 : 0 );*/ return( 1 ); } @@ -829,7 +829,7 @@ static int Demux_Seekable( input_thread_t *p_input ) if( p_stream->i_idxposb == 0 ) { - i_size += 8; // need to read and skip header + i_size += 8; /* need to read and skip header */ } if( ( p_pes = stream_PesPacket( p_input->s, __EVEN( i_size ) ) )==NULL ) @@ -839,12 +839,12 @@ static int Demux_Seekable( input_thread_t *p_input ) toread[i_stream].b_ok = VLC_FALSE; continue; } - if( i_size % 2 ) // read was padded on word boundary + if( i_size % 2 ) /* read was padded on word boundary */ { p_pes->p_last->p_payload_end--; p_pes->i_pes_size--; } - // skip header + /* skip header */ if( p_stream->i_idxposb == 0 ) { p_pes->p_first->p_payload_start += 8; @@ -898,7 +898,7 @@ static int Demux_Seekable( input_thread_t *p_input ) toread[i_stream].i_posf = -1; } - b_stream = VLC_TRUE; // at least one read succeed + b_stream = VLC_TRUE; /* at least one read succeed */ if( p_stream->p_es && p_stream->p_es->p_decoder_fifo && ( b_play_audio || p_stream->i_cat != AUDIO_ES ) ) @@ -998,7 +998,7 @@ static int Demux_UnSeekable( input_thread_t *p_input ) { return( !AVI_PacketNext( p_input ) ? 1 : 0 ); } - return( 0 ); // eof + return( 0 ); /* eof */ default: msg_Warn( p_input, "seems to have lost position, resync" ); @@ -1158,7 +1158,7 @@ static int Seek( input_thread_t *p_input, mtime_t i_date, int i_percent ) for( i_stream = 0; i_stream < p_avi->i_streams; i_stream++ ) { if( p_stream->b_activated && !p_stream->i_samplesize ) -// if( p_stream->b_activated ) +/* if( p_stream->b_activated ) */ { AVI_StreamSeek( p_input, i_stream, i_date ); p_avi->i_time = __MAX( AVI_GetPTS( p_stream ), @@ -1176,7 +1176,7 @@ static int Seek( input_thread_t *p_input, mtime_t i_date, int i_percent ) if( p_stream->b_activated && p_stream->i_samplesize ) { AVI_StreamSeek( p_input, i_stream, i_date ); -// p_avi->i_time = __MAX( AVI_GetPTS( p_stream ), p_avi->i_time ); +/* p_avi->i_time = __MAX( AVI_GetPTS( p_stream ), p_avi->i_time );*/ } } msg_Dbg( p_input, "seek: "I64Fd" secondes", p_avi->i_time /1000000 ); @@ -1722,7 +1722,7 @@ static int AVI_GetKeyFlag( vlc_fourcc_t i_fourcc, uint8_t *p_byte ) return p_byte[4] & 0x06 ? 0 : AVIIF_KEYFRAME; } case FOURCC_DIV2: - case FOURCC_DIV3: // wmv1 also + case FOURCC_DIV3: /* wmv1 also */ /* we have * picture type 0(I),1(P) 2bits */ @@ -1756,7 +1756,7 @@ vlc_fourcc_t AVI_FourccGetCodec( unsigned int i_cat, vlc_fourcc_t i_codec ) return i_codec; case VIDEO_ES: - // XXX DIV1 <- msmpeg4v1, DIV2 <- msmpeg4v2, DIV3 <- msmpeg4v3, mp4v for mpeg4 + /* XXX DIV1 <- msmpeg4v1, DIV2 <- msmpeg4v2, DIV3 <- msmpeg4v3, mp4v for mpeg4 */ switch( i_codec ) { case FOURCC_DIV1: diff --git a/modules/demux/avi/avi.h b/modules/demux/avi/avi.h index 1e66e5b52f..815451d3a4 100644 --- a/modules/demux/avi/avi.h +++ b/modules/demux/avi/avi.h @@ -2,7 +2,7 @@ * avi.h : AVI file Stream input module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: avi.h,v 1.15 2003/09/13 17:42:15 fenrir Exp $ + * $Id: avi.h,v 1.16 2003/10/19 13:39:11 hartman Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -25,9 +25,9 @@ typedef struct avi_packet_s vlc_fourcc_t i_fourcc; off_t i_pos; uint32_t i_size; - vlc_fourcc_t i_type; // only for AVIFOURCC_LIST + vlc_fourcc_t i_type; /* only for AVIFOURCC_LIST */ - uint8_t i_peek[8]; //first 8 bytes + uint8_t i_peek[8]; /* first 8 bytes */ unsigned int i_stream; unsigned int i_cat; diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c index 1590ecec2a..618e6dfc73 100644 --- a/modules/demux/avi/libavi.c +++ b/modules/demux/avi/libavi.c @@ -2,7 +2,7 @@ * libavi.c : ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: libavi.c,v 1.26 2003/09/07 22:48:29 fenrir Exp $ + * $Id: libavi.c,v 1.27 2003/10/19 13:39:11 hartman Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -142,7 +142,7 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container ) { return AVI_NextChunk( s, p_container ); } - return VLC_SUCCESS; // point at begining of LIST-movi + return VLC_SUCCESS; /* point at begining of LIST-movi */ } if( stream_Read( s, NULL, 12 ) != 12 ) @@ -337,6 +337,12 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) p_chk->strf.auds.p_wf->cbSize = p_chk->common.i_chunk_size - sizeof( WAVEFORMATEX ); } + if( p_chk->strf.auds.p_wf->wFormatTag == WAVE_FORMAT_EXTENSIBLE ) + { + /* Found an extensible header atm almost nothing uses that. */ + msg_Warn( (vlc_object_t*)s, "WAVE_FORMAT_EXTENSIBLE or vorbis + audio dectected: both are not supported" ); + } } else { @@ -345,7 +351,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) if( p_chk->strf.auds.p_wf->cbSize > 0 ) { memcpy( &p_chk->strf.auds.p_wf[1] , - p_buff + 8 + sizeof( WAVEFORMATEX ), // 8=fourrc+size + p_buff + 8 + sizeof( WAVEFORMATEX ), /* 8=fourrc+size */ p_chk->strf.auds.p_wf->cbSize ); } #ifdef AVI_DEBUG @@ -359,7 +365,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) #endif break; case( AVIFOURCC_vids ): - p_strh->strh.i_samplesize = 0; // XXX for ffmpeg avi file + p_strh->strh.i_samplesize = 0; /* XXX for ffmpeg avi file */ p_chk->strf.vids.i_cat = VIDEO_ES; p_chk->strf.vids.p_bih = malloc( p_chk->common.i_chunk_size ); AVI_READ4BYTES( p_chk->strf.vids.p_bih->biSize ); @@ -381,7 +387,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) if( p_chk->strf.vids.p_bih->biSize - sizeof(BITMAPINFOHEADER) > 0 ) { memcpy( &p_chk->strf.vids.p_bih[1], - p_buff + 8 + sizeof(BITMAPINFOHEADER), // 8=fourrc+size + p_buff + 8 + sizeof(BITMAPINFOHEADER), /* 8=fourrc+size */ p_chk->strf.vids.p_bih->biSize - sizeof(BITMAPINFOHEADER) ); } diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h index efdc3ee702..8aa6030e97 100644 --- a/modules/demux/avi/libavi.h +++ b/modules/demux/avi/libavi.h @@ -2,7 +2,7 @@ * libavi.h : LibAVI library ****************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: libavi.h,v 1.11 2003/08/22 20:31:47 fenrir Exp $ + * $Id: libavi.h,v 1.12 2003/10/19 13:39:12 hartman Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -33,9 +33,9 @@ #define AVIIF_NOTIME 0x00000100L /* this frame doesn't take any time */ #define AVIIF_COMPUSE 0x0FFF0000L /* these bits are for compressor use */ -#define AVIIF_FIXKEYFRAME 0x00001000L /* invented; used to say that - the keyframe flag isn't a true flag - but have to be verified */ +#define AVIIF_FIXKEYFRAME 0x00001000L /* invented; used to say that */ + /* the keyframe flag isn't a true flag */ + /* but have to be verified */ #define AVI_CHUNK_COMMON \ vlc_fourcc_t i_chunk_fourcc; \ diff --git a/modules/gui/macosx/info.m b/modules/gui/macosx/info.m index d3041758d8..74aa9744dd 100644 --- a/modules/gui/macosx/info.m +++ b/modules/gui/macosx/info.m @@ -2,7 +2,7 @@ * info.m: MacOS X info panel ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: info.m,v 1.7 2003/09/20 13:46:00 hartman Exp $ + * $Id: info.m,v 1.8 2003/10/19 13:39:12 hartman Exp $ * * Authors: Derk-Jan Hartman * @@ -105,7 +105,7 @@ } vlc_mutex_unlock( &p_input->stream.stream_lock ); - vlc_object_release( p_input ); + if( p_input ) vlc_object_release( p_input ); int i_select = [o_selector indexOfItemWithTitle:o_selectedPane]; if ( i_select < 0 ) @@ -160,11 +160,8 @@ { bEnabled = FALSE; } - else - { - vlc_object_release( p_input ); - } } + if( p_input ) vlc_object_release( p_input ); return( bEnabled ); }