diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_film.c | 9 | ||||
-rw-r--r-- | src/demuxers/demux_flv.c | 6 | ||||
-rw-r--r-- | src/demuxers/demux_iff.c | 107 | ||||
-rw-r--r-- | src/demuxers/demux_matroska.c | 32 | ||||
-rw-r--r-- | src/demuxers/demux_real.c | 9 | ||||
-rw-r--r-- | src/demuxers/demux_realaudio.c | 4 | ||||
-rw-r--r-- | src/input/input_cdda.c | 32 | ||||
-rw-r--r-- | src/input/input_http.c | 3 | ||||
-rw-r--r-- | src/input/input_mms.c | 4 | ||||
-rw-r--r-- | src/libxinevdec/bitplane.c | 38 | ||||
-rw-r--r-- | src/libxinevdec/foovideo.c | 8 | ||||
-rw-r--r-- | src/libxinevdec/rgb.c | 8 | ||||
-rw-r--r-- | src/libxinevdec/yuv.c | 11 | ||||
-rw-r--r-- | src/video_out/video_out_aa.c | 25 | ||||
-rw-r--r-- | src/video_out/video_out_caca.c | 35 |
15 files changed, 84 insertions, 247 deletions
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 26a7a9713..029913846 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -251,8 +251,7 @@ static int open_film_file(demux_film_t *film) { llprintf(DEBUG_FILM_LOAD, "parsing STAB chunk\n"); /* load the sample table */ - if (film->sample_table) - free(film->sample_table); + free(film->sample_table); film->frequency = _X_BE_32(&film_header[i + 8]); film->sample_count = _X_BE_32(&film_header[i + 12]); film->sample_table = @@ -329,8 +328,7 @@ static int open_film_file(demux_film_t *film) { /* allocate enough space in the interleave preload buffer for the * first chunk (which will be more than enough for successive chunks) */ if (film->audio_type) { - if (film->interleave_buffer) - free(film->interleave_buffer); + free(film->interleave_buffer); film->interleave_buffer = xine_xmalloc(film->sample_table[0].sample_size); } @@ -821,8 +819,7 @@ static int demux_film_seek (demux_plugin_t *this_gen, off_t start_pos, int start static void demux_film_dispose (demux_plugin_t *this_gen) { demux_film_t *this = (demux_film_t *) this_gen; - if (this->sample_table) - free(this->sample_table); + free(this->sample_table); free(this->interleave_buffer); free(this); } diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c index adb29d69d..00b1bb7f5 100644 --- a/src/demuxers/demux_flv.c +++ b/src/demuxers/demux_flv.c @@ -306,8 +306,7 @@ static int parse_flv_var(demux_flv_t *this, num = _X_BE_32(tmp); tmp += 4; if (key && keylen == 5 && !strncmp(key, "times", 5)) { - if (this->index) - free (this->index); + free (this->index); this->index = xine_xcalloc(num, sizeof(flv_index_entry_t)); this->num_indices = num; for (num = 0; num < this->num_indices && tmp < end; num++) { @@ -808,8 +807,7 @@ static int demux_flv_seek (demux_plugin_t *this_gen, static void demux_flv_dispose (demux_plugin_t *this_gen) { demux_flv_t *this = (demux_flv_t *) this_gen; - if (this->index) - free(this->index); + free(this->index); free(this); } diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c index d914405db..7e64e3a98 100644 --- a/src/demuxers/demux_iff.c +++ b/src/demuxers/demux_iff.c @@ -1116,92 +1116,29 @@ static int demux_iff_seek (demux_plugin_t *this_gen, static void demux_iff_dispose (demux_plugin_t *this_gen) { demux_iff_t *this = (demux_iff_t *) this_gen; - if( this->bmhd ) { - free(this->bmhd); - this->bmhd = NULL; - } - if( this->cmap ) { - free( this->cmap ); - this->cmap = NULL; - } - if( this->grab ) { - free(this->grab); - this->grab = NULL; - } - if( this->dest ) { - free(this->dest); - this->dest = NULL; - } - if( this->camg ) { - free(this->camg); - this->camg = NULL; - } - if( this->ccrt ) { - free(this->ccrt); - this->ccrt = NULL; - } - if( this->dpi ) { - free(this->dpi); - this->dpi = NULL; - } + free(this->bmhd); + free(this->cmap); + free(this->grab); + free(this->dest); + free(this->camg); + free(this->ccrt); + free(this->dpi); + free(this->vhdr); + free(this->atak); + free(this->rlse); + free(this->anhd); + free(this->dpan); + + free(this->title); + free(this->copyright); + free(this->author); + free(this->annotations); + free(this->version); + free(this->text); + + free (this->audio_interleave_buffer); + free (this->audio_read_buffer); - if( this->vhdr ) { - free(this->vhdr); - this->vhdr = NULL; - } - if( this->atak ) - { - free( this->atak ); - this->atak = NULL; - } - if( this->rlse ) { - free( this->rlse ); - this->rlse = NULL; - } - - if( this->anhd ) { - free( this->anhd ); - this->anhd = NULL; - } - - if( this->dpan ) { - free( this->dpan ); - this->dpan = NULL; - } - - if( this->title ) { - free (this->title); - this->title = NULL; - } - if( this->copyright ) { - free (this->copyright); - this->copyright = NULL; - } - if( this->author ) { - free (this->author); - this->author = NULL; - } - if( this->annotations ) { - free (this->annotations); - this->annotations = NULL; - } - if( this->version ) { - free (this->version); - this->version = NULL; - } - if( this->text ) { - free (this->text); - this->text = NULL; - } - - if( this->audio_interleave_buffer ) { - free (this->audio_interleave_buffer); - this->audio_interleave_buffer = NULL; - } - if( this->audio_read_buffer ) { - free (this->audio_read_buffer); - this->audio_read_buffer = NULL; - } this->audio_buffer_filled = 0; free(this); diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 0169651a0..906b9a518 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -2672,37 +2672,27 @@ static void demux_matroska_dispose (demux_plugin_t *this_gen) { /* free tracks */ for (i = 0; i < this->num_tracks; i++) { - matroska_track_t *track; + matroska_track_t *const track; track = this->tracks[i]; - if (track->language) - free (track->language); - if (track->codec_id) - free (track->codec_id); - if (track->codec_private) - free (track->codec_private); - if (track->video_track) - free (track->video_track); - if (track->audio_track) - free (track->audio_track); - if (track->sub_track) - free (track->sub_track); + free (track->language); + free (track->codec_id); + free (track->codec_private); + free (track->video_track); + free (track->audio_track); + free (track->sub_track); free (track); } /* Free the cues. */ for (i = 0; i < this->num_indexes; i++) { - if (this->indexes[i].pos) - free(this->indexes[i].pos); - if (this->indexes[i].timecode) - free(this->indexes[i].timecode); + free(this->indexes[i].pos); + free(this->indexes[i].timecode); } - if (this->indexes) - free(this->indexes); + free(this->indexes); /* Free the top_level elem list */ - if (this->top_level_list) - free(this->top_level_list); + free(this->top_level_list); dispose_ebml_parser(this->ebml); free (this); diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 60fa91451..99d795fcd 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -1480,18 +1480,15 @@ static void demux_real_dispose (demux_plugin_t *this_gen) { for(i = 0; i < this->num_video_streams; i++) { real_free_mdpr(this->video_streams[i].mdpr); - if(this->video_streams[i].index) - free(this->video_streams[i].index); + free(this->video_streams[i].index); } for(i = 0; i < this->num_audio_streams; i++) { real_free_mdpr(this->audio_streams[i].mdpr); - if(this->audio_streams[i].index) - free(this->audio_streams[i].index); + free(this->audio_streams[i].index); } - if(this->fragment_tab) - free(this->fragment_tab); + free(this->fragment_tab); free(this); } diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index 1e7c3c7de..55922371f 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -297,9 +297,7 @@ static int demux_ra_seek (demux_plugin_t *this_gen, static void demux_ra_dispose (demux_plugin_t *this_gen) { demux_ra_t *this = (demux_ra_t *) this_gen; - if(this->header) - free(this->header); - + free(this->header); free(this); } diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 621aff14a..eedd0d80e 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -383,10 +383,10 @@ static cdrom_toc * init_cdrom_toc(void) { static void free_cdrom_toc(cdrom_toc *toc) { - if(toc && toc->toc_entries) + if ( toc ) { free(toc->toc_entries); - if (toc) - free (toc); + free(toc); + } } #if defined (__linux__) @@ -1985,26 +1985,15 @@ static void _cdda_free_cddb_info(cdda_input_plugin_t *this) { int t; for(t = 0; t < this->cddb.num_tracks; t++) { - if(this->cddb.track[t].title) - free(this->cddb.track[t].title); + free(this->cddb.track[t].title); } free(this->cddb.track); - - if(this->cddb.cdiscid) - free(this->cddb.cdiscid); - - if(this->cddb.disc_title) - free(this->cddb.disc_title); - - if(this->cddb.disc_artist) - free(this->cddb.disc_artist); - - if(this->cddb.disc_category) - free(this->cddb.disc_category); - - if(this->cddb.disc_year) - free(this->cddb.disc_year); + free(this->cddb.cdiscid); + free(this->cddb.disc_title); + free(this->cddb.disc_artist); + free(this->cddb.disc_category); + free(this->cddb.disc_year); } } @@ -2354,8 +2343,7 @@ static void cdda_plugin_dispose (input_plugin_t *this_gen ) { free(this->mrl); - if (this->cdda_device) - free(this->cdda_device); + free(this->cdda_device); if (this->class) { cdda_input_class_t *inp = (cdda_input_class_t *) this->class; inp->ip = NULL; diff --git a/src/input/input_http.c b/src/input/input_http.c index 328ab523e..5975bb64b 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -1076,8 +1076,7 @@ static const char *http_class_get_identifier (input_class_t *this_gen) { static void http_class_dispose (input_class_t *this_gen) { http_input_class_t *this = (http_input_class_t *) this_gen; - if(this->proxyhost_env) - free(this->proxyhost_env); + free(this->proxyhost_env); free (this); } diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 3e4b7172c..0b726fef0 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -285,9 +285,7 @@ static void mms_plugin_dispose (input_plugin_t *this_gen) { this->nbc = NULL; } - if(this->mrl) - free(this->mrl); - + free(this->mrl); free (this); } diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index b6940813f..a3b18d060 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1186,8 +1186,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen, this->ratio *= 2.0; } - if (this->buf) - free (this->buf); + free (this->buf); this->bufsize = VIDEOBUFSIZE; this->buf = xine_xmalloc(this->bufsize); this->size = 0; @@ -1483,35 +1482,12 @@ static void bitplane_discontinuity (video_decoder_t *this_gen) { static void bitplane_dispose (video_decoder_t *this_gen) { bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } - - if (this->buf_uk) { - free (this->buf_uk); - this->buf_uk = NULL; - } - - if (this->buf_uk_hist) { - free (this->buf_uk_hist); - this->buf_uk_hist = NULL; - } - - if (this->index_buf) { - free (this->index_buf); - this->index_buf = NULL; - } - - if (this->index_buf_hist) { - free (this->index_buf_hist); - this->index_buf_hist = NULL; - } - - if (this->index_buf) { - free (this->index_buf); - this->index_buf = NULL; - } + free (this->buf); + free (this->buf_uk); + free (this->buf_uk_hist); + free (this->index_buf); + free (this->index_buf_hist); + free (this->index_buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 98e0ebc0b..1113f8df0 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -98,8 +98,7 @@ static void foovideo_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ (this->stream->video_out->open) (this->stream->video_out, this->stream); - if(this->buf) - free(this->buf); + free(this->buf); bih = (xine_bmiheader *) buf->content; this->width = bih->biWidth; @@ -185,10 +184,7 @@ static void foovideo_dispose (video_decoder_t *this_gen) { foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 0e7be4c18..803e4fb3a 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -140,8 +140,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, this->bytes_per_pixel = (this->bit_depth + 1) / 8; - if (this->buf) - free (this->buf); + free (this->buf); /* minimal buffer size */ this->bufsize = this->width * this->height * this->bytes_per_pixel; @@ -381,10 +380,7 @@ static void rgb_discontinuity (video_decoder_t *this_gen) { static void rgb_dispose (video_decoder_t *this_gen) { rgb_decoder_t *this = (rgb_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 2b8657685..456a2cb93 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -104,10 +104,8 @@ static void yuv_decode_data (video_decoder_t *this_gen, this->progressive = buf->decoder_info[3]; this->top_field_first = buf->decoder_info[4]; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); + this->buf = NULL; this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); @@ -304,10 +302,7 @@ static void yuv_discontinuity (video_decoder_t *this_gen) { static void yuv_dispose (video_decoder_t *this_gen) { yuv_decoder_t *this = (yuv_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index 012db9665..035e2d98b 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.c @@ -87,12 +87,9 @@ static uint32_t aa_get_capabilities (vo_driver_t *this) { static void aa_dispose_frame (vo_frame_t *vo_img) { aa_frame_t *frame = (aa_frame_t *)vo_img; - if (frame->mem[0]) - free (frame->mem[0]); - if (frame->mem[1]) - free (frame->mem[1]); - if (frame->mem[2]) - free (frame->mem[2]); + free (frame->mem[0]); + free (frame->mem[1]); + free (frame->mem[2]); free (frame); } @@ -132,19 +129,9 @@ static void aa_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img, if ((frame->width != width) || (frame->height != height) || (frame->format != format)) { - if (frame->mem[0]) { - free (frame->mem[0]); - frame->mem[0] = NULL; - } - if (frame->mem[1]) { - free (frame->mem[1]); - frame->mem[1] = NULL; - } - - if (frame->mem[2]) { - free (frame->mem[2]); - frame->mem[2] = NULL; - } + free (frame->mem[0]); frame->mem[0] = NULL; + free (frame->mem[1]); frame->mem[1] = NULL; + free (frame->mem[2]); frame->mem[2] = NULL; frame->width = width; frame->height = height; diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c index 866eabcd8..559efbd6c 100644 --- a/src/video_out/video_out_caca.c +++ b/src/video_out/video_out_caca.c @@ -94,15 +94,11 @@ static uint32_t caca_get_capabilities (vo_driver_t *this) { static void caca_dispose_frame (vo_frame_t *vo_img) { caca_frame_t *frame = (caca_frame_t *)vo_img; - if (frame->mem[0]) - free (frame->mem[0]); - if (frame->mem[1]) - free (frame->mem[1]); - if (frame->mem[2]) - free (frame->mem[2]); - - if (frame->pixmap_d) - free (frame->pixmap_d); + free (frame->mem[0]); + free (frame->mem[1]); + free (frame->mem[2]); + + free (frame->pixmap_d); if (frame->pixmap_s) cucul_free_dither (frame->pixmap_s); @@ -148,23 +144,12 @@ static void caca_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img, if ((frame->width != width) || (frame->height != height) || (frame->format != format)) { - if (frame->mem[0]) { - free (frame->mem[0]); - frame->mem[0] = NULL; - } - if (frame->mem[1]) { - free (frame->mem[1]); - frame->mem[1] = NULL; - } - if (frame->mem[2]) { - free (frame->mem[2]); - frame->mem[2] = NULL; - } + free (frame->mem[0]); frame->mem[0] = NULL; + free (frame->mem[1]); frame->mem[1] = NULL; + free (frame->mem[2]); frame->mem[2] = NULL; + + free (frame->pixmap_d); frame->pixmap_d = NULL; - if (frame->pixmap_d) { - free (frame->pixmap_d); - frame->pixmap_d = NULL; - } if (frame->pixmap_s) { cucul_free_dither (frame->pixmap_s); frame->pixmap_s = NULL; |