Changeset 380edbae4061b349232364c7d7989c4ef8e8931f
- Timestamp:
- 26/11/03 09:18:09
(5 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1069834689 +0000
- git-parent:
[695943b9f6d103e9540353dfdb9c5ebfcba4d50b]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1069834689 +0000
- Message:
* ALL: fixed memory leaks.
* modules/demux/mp4/libmp4.c: fixed parsing of the "wave" tag (I'm sure there's a better fix but this one works).
* modules/demux/ogg.c: another seeking fix (We also need to flush the per stream buffer with ogg_stream_reset()).
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rb367420 |
r380edba |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: postprocess.c,v 1.5 2003/11/24 00:01:42 gbazin Exp $ |
|---|
| | 5 | * $Id: postprocess.c,v 1.6 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 82 | 82 | var_Create( p_dec, "ffmpeg-pp-q", |
|---|
| 83 | 83 | VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT ); |
|---|
| 84 | | text.psz_string = _("Post-Processing"); |
|---|
| | 84 | text.psz_string = _("Post processing"); |
|---|
| 85 | 85 | var_Change( p_dec, "ffmpeg-pp-q", VLC_VAR_SETTEXT, &text, NULL ); |
|---|
| 86 | 86 | |
|---|
| … | … | |
| 201 | 201 | |
|---|
| 202 | 202 | var_DelCallback( p_dec, "ffmpeg-pp-q", PPQCallback, p_sys ); |
|---|
| | 203 | |
|---|
| | 204 | if( p_sys ) free( p_sys ); |
|---|
| 203 | 205 | } |
|---|
| 204 | 206 | |
|---|
| r98d646e |
r380edba |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: avi.c,v 1.76 2003/11/24 13:40:03 gbazin Exp $ |
|---|
| | 5 | * $Id: avi.c,v 1.77 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 6 | 6 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| 7 | 7 | * |
|---|
| … | … | |
| 279 | 279 | fmt.audio.i_blockalign = p_auds->p_wf->nBlockAlign; |
|---|
| 280 | 280 | fmt.audio.i_bitspersample = p_auds->p_wf->wBitsPerSample; |
|---|
| 281 | | if( ( fmt.i_extra = __MIN( p_auds->p_wf->cbSize, |
|---|
| 282 | | p_auds->i_chunk_size - sizeof(WAVEFORMATEX) ) ) > 0 ) |
|---|
| 283 | | { |
|---|
| 284 | | fmt.p_extra = malloc( fmt.i_extra ); |
|---|
| 285 | | memcpy( fmt.p_extra, &p_auds->p_wf[1], fmt.i_extra ); |
|---|
| 286 | | } |
|---|
| | 281 | fmt.i_extra = __MIN( p_auds->p_wf->cbSize, |
|---|
| | 282 | p_auds->i_chunk_size - sizeof(WAVEFORMATEX) ); |
|---|
| | 283 | fmt.p_extra = &p_auds->p_wf[1]; |
|---|
| 287 | 284 | msg_Dbg( p_input, "stream[%d] audio(0x%x) %d channels %dHz %dbits", |
|---|
| 288 | | i, |
|---|
| 289 | | p_auds->p_wf->wFormatTag, p_auds->p_wf->nChannels, |
|---|
| | 285 | i, p_auds->p_wf->wFormatTag, p_auds->p_wf->nChannels, |
|---|
| 290 | 286 | p_auds->p_wf->nSamplesPerSec, p_auds->p_wf->wBitsPerSample); |
|---|
| 291 | 287 | break; |
|---|
| … | … | |
| 299 | 295 | fmt.video.i_width = p_vids->p_bih->biWidth; |
|---|
| 300 | 296 | fmt.video.i_height = p_vids->p_bih->biHeight; |
|---|
| 301 | | if( ( fmt.i_extra = __MIN( p_vids->p_bih->biSize - sizeof( BITMAPINFOHEADER ), |
|---|
| 302 | | p_vids->i_chunk_size - sizeof(BITMAPINFOHEADER) ) ) > 0 ) |
|---|
| 303 | | { |
|---|
| 304 | | fmt.p_extra = malloc( fmt.i_extra ); |
|---|
| 305 | | memcpy( fmt.p_extra, &p_vids->p_bih[1], fmt.i_extra ); |
|---|
| 306 | | } |
|---|
| | 297 | fmt.i_extra = |
|---|
| | 298 | __MIN( p_vids->p_bih->biSize - sizeof( BITMAPINFOHEADER ), |
|---|
| | 299 | p_vids->i_chunk_size - sizeof(BITMAPINFOHEADER) ); |
|---|
| | 300 | fmt.p_extra = &p_vids->p_bih[1]; |
|---|
| 307 | 301 | msg_Dbg( p_input, "stream[%d] video(%4.4s) %dx%d %dbpp %ffps", |
|---|
| 308 | 302 | i, |
|---|
| r67c26fd |
r380edba |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: libmp4.c,v 1.34 2003/10/07 14:59:10 gbazin Exp $ |
|---|
| | 5 | * $Id: libmp4.c,v 1.35 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 6 | 6 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| 7 | 7 | * |
|---|
| … | … | |
| 1205 | 1205 | MP4_READBOX_ENTER( MP4_Box_data_sample_soun_t ); |
|---|
| 1206 | 1206 | |
|---|
| | 1207 | /* Sanity check needed because the "wave" box does also contain an |
|---|
| | 1208 | * "mp4a" box that we don't understand. */ |
|---|
| | 1209 | if( i_read < 28 ) |
|---|
| | 1210 | { |
|---|
| | 1211 | i_read -= 30; |
|---|
| | 1212 | MP4_READBOX_EXIT( 0 ); |
|---|
| | 1213 | } |
|---|
| | 1214 | |
|---|
| 1207 | 1215 | for( i = 0; i < 6 ; i++ ) |
|---|
| 1208 | 1216 | { |
|---|
| … | … | |
| 1215 | 1223 | * XXX hack -> produce a copy of the nearly complete chunk |
|---|
| 1216 | 1224 | */ |
|---|
| 1217 | | if( i_read > 0 ) |
|---|
| 1218 | | { |
|---|
| 1219 | | p_box->data.p_sample_soun->i_qt_description = i_read; |
|---|
| 1220 | | p_box->data.p_sample_soun->p_qt_description = malloc( i_read ); |
|---|
| 1221 | | memcpy( p_box->data.p_sample_soun->p_qt_description, |
|---|
| 1222 | | p_peek, |
|---|
| 1223 | | i_read ); |
|---|
| 1224 | | } |
|---|
| 1225 | | else |
|---|
| 1226 | | { |
|---|
| 1227 | | p_box->data.p_sample_soun->i_qt_description = 0; |
|---|
| 1228 | | p_box->data.p_sample_soun->p_qt_description = NULL; |
|---|
| 1229 | | } |
|---|
| | 1225 | p_box->data.p_sample_soun->i_qt_description = i_read; |
|---|
| | 1226 | p_box->data.p_sample_soun->p_qt_description = malloc( i_read ); |
|---|
| | 1227 | memcpy( p_box->data.p_sample_soun->p_qt_description, p_peek, i_read ); |
|---|
| 1230 | 1228 | |
|---|
| 1231 | 1229 | MP4_GET2BYTES( p_box->data.p_sample_soun->i_qt_version ); |
|---|
| r9c37455 |
r380edba |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001-2003 VideoLAN |
|---|
| 5 | | * $Id: ogg.c,v 1.46 2003/11/23 13:15:27 gbazin Exp $ |
|---|
| | 5 | * $Id: ogg.c,v 1.47 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 79 | 79 | mtime_t i_pcr; |
|---|
| 80 | 80 | int b_reinit; |
|---|
| 81 | | int i_prev_sync_state; |
|---|
| 82 | 81 | |
|---|
| 83 | 82 | /* stream state */ |
|---|
| … | … | |
| 1029 | 1028 | p_ogg->i_eos = 0; |
|---|
| 1030 | 1029 | |
|---|
| 1031 | | p_ogg->i_prev_sync_state = SYNCHRO_REINIT; |
|---|
| 1032 | | |
|---|
| 1033 | 1030 | return 0; |
|---|
| 1034 | 1031 | |
|---|
| … | … | |
| 1171 | 1168 | p_stream->i_pcr = -1; |
|---|
| 1172 | 1169 | p_stream->i_interpolated_pcr = -1; |
|---|
| | 1170 | ogg_stream_reset( &p_stream->os ); |
|---|
| 1173 | 1171 | } |
|---|
| 1174 | | if( p_ogg->i_prev_sync_state != SYNCHRO_REINIT ) |
|---|
| 1175 | | ogg_sync_reset( &p_ogg->oy ); |
|---|
| 1176 | | } |
|---|
| 1177 | | |
|---|
| 1178 | | p_ogg->i_prev_sync_state = |
|---|
| 1179 | | p_input->stream.p_selected_program->i_synchro_state; |
|---|
| | 1172 | ogg_sync_reset( &p_ogg->oy ); |
|---|
| | 1173 | } |
|---|
| 1180 | 1174 | |
|---|
| 1181 | 1175 | /* |
|---|
| … | … | |
| 1226 | 1220 | { |
|---|
| 1227 | 1221 | input_ClockManageRef( p_input, |
|---|
| 1228 | | p_input->stream.p_selected_program, p_ogg->i_pcr ); |
|---|
| | 1222 | p_input->stream.p_selected_program, |
|---|
| | 1223 | p_stream->i_pcr ); |
|---|
| 1229 | 1224 | } |
|---|
| 1230 | 1225 | continue; |
|---|
| … | … | |
| 1249 | 1244 | } |
|---|
| 1250 | 1245 | |
|---|
| 1251 | | if( p_input->stream.p_selected_program->i_synchro_state != SYNCHRO_REINIT ) |
|---|
| | 1246 | if( p_ogg->i_pcr >= 0 ) |
|---|
| 1252 | 1247 | { |
|---|
| 1253 | 1248 | input_ClockManageRef( p_input, p_input->stream.p_selected_program, |
|---|
| r3557949 |
r380edba |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001, 2002 VideoLAN |
|---|
| 5 | | * $Id: mpeg4video.c,v 1.16 2003/11/18 20:15:38 fenrir Exp $ |
|---|
| | 5 | * $Id: mpeg4video.c,v 1.17 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 129 | 129 | p_sys->b_vop = VLC_FALSE; |
|---|
| 130 | 130 | p_sys->i_buffer = 0; |
|---|
| 131 | | p_sys->i_buffer_size = 10000; |
|---|
| 132 | | p_sys->p_buffer = malloc( p_sys->i_buffer_size ); |
|---|
| | 131 | p_sys->i_buffer_size = 0; |
|---|
| | 132 | p_sys->p_buffer = 0; |
|---|
| 133 | 133 | |
|---|
| 134 | 134 | /* Setup properties */ |
|---|
| … | … | |
| 168 | 168 | decoder_t *p_dec = (decoder_t*)p_this; |
|---|
| 169 | 169 | |
|---|
| | 170 | if( p_dec->p_sys->p_buffer ) free( p_dec->p_sys->p_buffer ); |
|---|
| 170 | 171 | free( p_dec->p_sys ); |
|---|
| 171 | 172 | } |
|---|
| r89fd537 |
r380edba |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: input_dec.c,v 1.79 2003/11/24 23:22:01 gbazin Exp $ |
|---|
| | 5 | * $Id: input_dec.c,v 1.80 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Christophe Massiot <massiot@via.ecp.fr> |
|---|
| … | … | |
| 611 | 611 | |
|---|
| 612 | 612 | if( p_dec->p_owner->p_sout ) |
|---|
| | 613 | { |
|---|
| 613 | 614 | sout_InputDelete( p_dec->p_owner->p_sout ); |
|---|
| | 615 | if( p_dec->p_owner->sout.i_extra ) free(p_dec->p_owner->sout.p_extra); |
|---|
| | 616 | } |
|---|
| | 617 | |
|---|
| | 618 | if( p_dec->fmt_in.i_extra ) free( p_dec->fmt_in.p_extra ); |
|---|
| | 619 | if( p_dec->fmt_out.i_extra ) free( p_dec->fmt_out.p_extra ); |
|---|
| 614 | 620 | |
|---|
| 615 | 621 | free( p_dec->p_owner ); |
|---|
| r3439df8 |
r380edba |
|
| 6 | 6 | ***************************************************************************** |
|---|
| 7 | 7 | * Copyright (C) 2000-2001 VideoLAN |
|---|
| 8 | | * $Id: video_output.c,v 1.240 2003/11/24 00:39:02 fenrir Exp $ |
|---|
| | 8 | * $Id: video_output.c,v 1.241 2003/11/26 08:18:09 gbazin Exp $ |
|---|
| 9 | 9 | * |
|---|
| 10 | 10 | * Authors: Vincent Seguin <seguin@via.ecp.fr> |
|---|
| … | … | |
| 439 | 439 | { |
|---|
| 440 | 440 | var_Set( p_vout, "deinterlace", val ); |
|---|
| | 441 | if( val.psz_string ) free( val.psz_string ); |
|---|
| 441 | 442 | } |
|---|
| 442 | 443 | var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL ); |
|---|
| … | … | |
| 447 | 448 | var_Change( p_vout, "filter", VLC_VAR_SETTEXT, &text, NULL ); |
|---|
| 448 | 449 | var_Change( p_vout, "filter", VLC_VAR_INHERITVALUE, &val, NULL ); |
|---|
| 449 | | if( var_Get( p_vout, "filter", &val ) == VLC_SUCCESS ) |
|---|
| | 450 | if( val.psz_string ) |
|---|
| 450 | 451 | { |
|---|
| 451 | 452 | var_Set( p_vout, "filter", val ); |
|---|
| | 453 | free( val.psz_string ); |
|---|
| 452 | 454 | } |
|---|
| 453 | 455 | var_AddCallback( p_vout, "filter", FilterCallback, NULL ); |
|---|
| … | … | |
| 498 | 500 | p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, |
|---|
| 499 | 501 | FIND_ANYWHERE ); |
|---|
| | 502 | |
|---|
| | 503 | if( p_vout->psz_filter_chain ) free( p_vout->psz_filter_chain ); |
|---|
| 500 | 504 | |
|---|
| 501 | 505 | /* Free structure */ |
|---|