Commit 898575aa authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* 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.
parent af0b400d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc * avi.c : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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 <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -576,9 +576,9 @@ typedef struct avi_stream_toread_s ...@@ -576,9 +576,9 @@ typedef struct avi_stream_toread_s
int i_toread; int i_toread;
off_t i_posf; // where we will read : off_t i_posf; /* where we will read :
// if i_idxposb == 0 : begining of chunk (+8 to acces data) if i_idxposb == 0 : begining of chunk (+8 to acces data)
// else : point on data directly else : point on data directly */
} avi_stream_toread_t; } avi_stream_toread_t;
static int Demux_Seekable( input_thread_t *p_input ) static int Demux_Seekable( input_thread_t *p_input )
...@@ -588,7 +588,7 @@ 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_stream;
vlc_bool_t b_play_audio; vlc_bool_t b_play_audio;
vlc_bool_t b_video; /* is there some video track selected */ 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]; avi_stream_toread_t toread[100];
demux_sys_t *p_avi = p_input->p_demux_data; demux_sys_t *p_avi = p_input->p_demux_data;
...@@ -707,7 +707,7 @@ static int Demux_Seekable( input_thread_t *p_input ) ...@@ -707,7 +707,7 @@ static int Demux_Seekable( input_thread_t *p_input )
if( toread[i].i_toread > 0 ) 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 ) if( toread[i].i_posf > 0 )
...@@ -722,7 +722,7 @@ static int Demux_Seekable( input_thread_t *p_input ) ...@@ -722,7 +722,7 @@ static int Demux_Seekable( input_thread_t *p_input )
if( b_done ) if( b_done )
{ {
// return( b_stream ? 1 : 0 ); /* return( b_stream ? 1 : 0 );*/
return( 1 ); return( 1 );
} }
...@@ -829,7 +829,7 @@ static int Demux_Seekable( input_thread_t *p_input ) ...@@ -829,7 +829,7 @@ static int Demux_Seekable( input_thread_t *p_input )
if( p_stream->i_idxposb == 0 ) 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 ) 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 ) ...@@ -839,12 +839,12 @@ static int Demux_Seekable( input_thread_t *p_input )
toread[i_stream].b_ok = VLC_FALSE; toread[i_stream].b_ok = VLC_FALSE;
continue; 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->p_last->p_payload_end--;
p_pes->i_pes_size--; p_pes->i_pes_size--;
} }
// skip header /* skip header */
if( p_stream->i_idxposb == 0 ) if( p_stream->i_idxposb == 0 )
{ {
p_pes->p_first->p_payload_start += 8; p_pes->p_first->p_payload_start += 8;
...@@ -898,7 +898,7 @@ static int Demux_Seekable( input_thread_t *p_input ) ...@@ -898,7 +898,7 @@ static int Demux_Seekable( input_thread_t *p_input )
toread[i_stream].i_posf = -1; 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 && if( p_stream->p_es && p_stream->p_es->p_decoder_fifo &&
( b_play_audio || p_stream->i_cat != AUDIO_ES ) ) ( b_play_audio || p_stream->i_cat != AUDIO_ES ) )
...@@ -998,7 +998,7 @@ static int Demux_UnSeekable( input_thread_t *p_input ) ...@@ -998,7 +998,7 @@ static int Demux_UnSeekable( input_thread_t *p_input )
{ {
return( !AVI_PacketNext( p_input ) ? 1 : 0 ); return( !AVI_PacketNext( p_input ) ? 1 : 0 );
} }
return( 0 ); // eof return( 0 ); /* eof */
default: default:
msg_Warn( p_input, msg_Warn( p_input,
"seems to have lost position, resync" ); "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 ) ...@@ -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++ ) 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 && !p_stream->i_samplesize )
// if( p_stream->b_activated ) /* if( p_stream->b_activated ) */
{ {
AVI_StreamSeek( p_input, i_stream, i_date ); AVI_StreamSeek( p_input, i_stream, i_date );
p_avi->i_time = __MAX( AVI_GetPTS( p_stream ), 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 ) ...@@ -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 ) if( p_stream->b_activated && p_stream->i_samplesize )
{ {
AVI_StreamSeek( p_input, i_stream, i_date ); 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 ); 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 ) ...@@ -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; return p_byte[4] & 0x06 ? 0 : AVIIF_KEYFRAME;
} }
case FOURCC_DIV2: case FOURCC_DIV2:
case FOURCC_DIV3: // wmv1 also case FOURCC_DIV3: /* wmv1 also */
/* we have /* we have
* picture type 0(I),1(P) 2bits * 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 ) ...@@ -1756,7 +1756,7 @@ vlc_fourcc_t AVI_FourccGetCodec( unsigned int i_cat, vlc_fourcc_t i_codec )
return i_codec; return i_codec;
case VIDEO_ES: 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 ) switch( i_codec )
{ {
case FOURCC_DIV1: case FOURCC_DIV1:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* avi.h : AVI file Stream input module for vlc * avi.h : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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 <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -25,9 +25,9 @@ typedef struct avi_packet_s ...@@ -25,9 +25,9 @@ typedef struct avi_packet_s
vlc_fourcc_t i_fourcc; vlc_fourcc_t i_fourcc;
off_t i_pos; off_t i_pos;
uint32_t i_size; 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_stream;
unsigned int i_cat; unsigned int i_cat;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libavi.c : * libavi.c :
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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 <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 ) ...@@ -142,7 +142,7 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
{ {
return AVI_NextChunk( s, 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 ) if( stream_Read( s, NULL, 12 ) != 12 )
...@@ -337,6 +337,12 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) ...@@ -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->strf.auds.p_wf->cbSize =
p_chk->common.i_chunk_size - sizeof( WAVEFORMATEX ); 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 else
{ {
...@@ -345,7 +351,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) ...@@ -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 ) if( p_chk->strf.auds.p_wf->cbSize > 0 )
{ {
memcpy( &p_chk->strf.auds.p_wf[1] , 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 ); p_chk->strf.auds.p_wf->cbSize );
} }
#ifdef AVI_DEBUG #ifdef AVI_DEBUG
...@@ -359,7 +365,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) ...@@ -359,7 +365,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
#endif #endif
break; break;
case( AVIFOURCC_vids ): 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.i_cat = VIDEO_ES;
p_chk->strf.vids.p_bih = malloc( p_chk->common.i_chunk_size ); p_chk->strf.vids.p_bih = malloc( p_chk->common.i_chunk_size );
AVI_READ4BYTES( p_chk->strf.vids.p_bih->biSize ); 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 ) ...@@ -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 ) if( p_chk->strf.vids.p_bih->biSize - sizeof(BITMAPINFOHEADER) > 0 )
{ {
memcpy( &p_chk->strf.vids.p_bih[1], 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 - p_chk->strf.vids.p_bih->biSize -
sizeof(BITMAPINFOHEADER) ); sizeof(BITMAPINFOHEADER) );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libavi.h : LibAVI library * libavi.h : LibAVI library
****************************************************************************** ******************************************************************************
* Copyright (C) 2001 VideoLAN * 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 <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#define AVIIF_NOTIME 0x00000100L /* this frame doesn't take any time */ #define AVIIF_NOTIME 0x00000100L /* this frame doesn't take any time */
#define AVIIF_COMPUSE 0x0FFF0000L /* these bits are for compressor use */ #define AVIIF_COMPUSE 0x0FFF0000L /* these bits are for compressor use */
#define AVIIF_FIXKEYFRAME 0x00001000L /* invented; used to say that #define AVIIF_FIXKEYFRAME 0x00001000L /* invented; used to say that */
the keyframe flag isn't a true flag /* the keyframe flag isn't a true flag */
but have to be verified */ /* but have to be verified */
#define AVI_CHUNK_COMMON \ #define AVI_CHUNK_COMMON \
vlc_fourcc_t i_chunk_fourcc; \ vlc_fourcc_t i_chunk_fourcc; \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* info.m: MacOS X info panel * info.m: MacOS X info panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* *
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); 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]; int i_select = [o_selector indexOfItemWithTitle:o_selectedPane];
if ( i_select < 0 ) if ( i_select < 0 )
...@@ -160,11 +160,8 @@ ...@@ -160,11 +160,8 @@
{ {
bEnabled = FALSE; bEnabled = FALSE;
} }
else
{
vlc_object_release( p_input );
}
} }
if( p_input ) vlc_object_release( p_input );
return( bEnabled ); return( bEnabled );
} }
......
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