summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-11 16:23:37 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-11 16:23:37 +0100
commitaa43f8f317dc7880d783569921447b3c541db96a (patch)
treefc047c23ba77cfda7cef7b03761aba64fceef628 /src/demuxers
parent01bd55e4c0d1bf95421d489b9955cd895ccd85e7 (diff)
parent3df7af4a715ee88c9acbe0136a5d15564a9c10fd (diff)
downloadxine-lib-aa43f8f317dc7880d783569921447b3c541db96a.tar.gz
xine-lib-aa43f8f317dc7880d783569921447b3c541db96a.tar.bz2
Merge from 1.2 main branch.
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_film.c9
-rw-r--r--src/demuxers/demux_flv.c6
-rw-r--r--src/demuxers/demux_iff.c107
-rw-r--r--src/demuxers/demux_matroska.c35
-rw-r--r--src/demuxers/demux_real.c9
-rw-r--r--src/demuxers/demux_realaudio.c4
-rw-r--r--src/demuxers/demux_wc3movie.c2
7 files changed, 44 insertions, 128 deletions
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index 261aaac89..533328fdd 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 10f9c9afe..1c5a1e7b7 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 97d9c7a62..885b25b28 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 b4c79afd7..7b7358ac8 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -2672,37 +2672,26 @@ static void demux_matroska_dispose (demux_plugin_t *this_gen) {
/* free tracks */
for (i = 0; i < this->num_tracks; i++) {
- matroska_track_t *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);
+ matroska_track_t *const track = this->tracks[i];
+
+ 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 9f6a693ee..7ca6a75e7 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 f17f12800..02145edce 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/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index 33958cb2c..3d108937a 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -102,7 +102,7 @@ typedef struct {
} demux_mve_class_t;
/* bizarre palette lookup table */
-const unsigned char wc3_pal_lookup[] = {
+static const unsigned char wc3_pal_lookup[] = {
0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E, 0x10, 0x12, 0x13, 0x15, 0x16,
0x18, 0x19, 0x1A,
0x1C, 0x1D, 0x1F, 0x20, 0x21, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2A, 0x2C,