Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
2d824acd
Commit
2d824acd
authored
Aug 03, 2006
by
zorglub
Browse files
Fix duplicate definitions of FREE
parent
c17969a0
Changes
25
Hide whitespace changes
Inline
Side-by-side
modules/access/dvb/dvb.h
View file @
2d824acd
...
...
@@ -97,39 +97,34 @@ static __inline__ void en50221_MMIFree( en50221_mmi_object_t *p_object )
{
int
i
;
#define FREE( x ) \
if ( x != NULL ) \
free( x );
switch
(
p_object
->
i_object_type
)
{
case
EN50221_MMI_ENQ
:
FREE
(
p_object
->
u
.
enq
.
psz_text
);
FREE
NULL
(
p_object
->
u
.
enq
.
psz_text
);
break
;
case
EN50221_MMI_ANSW
:
if
(
p_object
->
u
.
answ
.
b_ok
)
{
FREE
(
p_object
->
u
.
answ
.
psz_answ
);
FREE
NULL
(
p_object
->
u
.
answ
.
psz_answ
);
}
break
;
case
EN50221_MMI_MENU
:
case
EN50221_MMI_LIST
:
FREE
(
p_object
->
u
.
menu
.
psz_title
);
FREE
(
p_object
->
u
.
menu
.
psz_subtitle
);
FREE
(
p_object
->
u
.
menu
.
psz_bottom
);
FREE
NULL
(
p_object
->
u
.
menu
.
psz_title
);
FREE
NULL
(
p_object
->
u
.
menu
.
psz_subtitle
);
FREE
NULL
(
p_object
->
u
.
menu
.
psz_bottom
);
for
(
i
=
0
;
i
<
p_object
->
u
.
menu
.
i_choices
;
i
++
)
{
FREE
(
p_object
->
u
.
menu
.
ppsz_choices
[
i
]
);
FREE
NULL
(
p_object
->
u
.
menu
.
ppsz_choices
[
i
]
);
}
FREE
(
p_object
->
u
.
menu
.
ppsz_choices
);
FREE
NULL
(
p_object
->
u
.
menu
.
ppsz_choices
);
break
;
default:
break
;
}
#undef FREE
}
#define MAX_DEMUX 256
...
...
modules/access/dvb/http.c
View file @
2d824acd
...
...
@@ -77,10 +77,6 @@ static int HttpCallback( httpd_file_sys_t *p_args,
*****************************************************************************/
int
E_
(
HTTPOpen
)(
access_t
*
p_access
)
{
#define FREE( x ) \
if ( (x) != NULL ) \
free( x );
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
char
*
psz_address
,
*
psz_cert
=
NULL
,
*
psz_key
=
NULL
,
*
psz_ca
=
NULL
,
*
psz_crl
=
NULL
,
*
psz_user
=
NULL
,
...
...
@@ -196,8 +192,6 @@ int E_(HTTPOpen)( access_t *p_access )
p_sys
->
p_httpd_redir
=
httpd_RedirectNew
(
p_sys
->
p_httpd_host
,
"/index.html"
,
"/"
);
#undef FREE
return
VLC_SUCCESS
;
}
...
...
modules/access/mms/mms.h
View file @
2d824acd
...
...
@@ -34,5 +34,3 @@ void E_( MMSTUClose ) ( access_t * );
/* mmsh */
int
E_
(
MMSHOpen
)
(
access_t
*
);
void
E_
(
MMSHClose
)
(
access_t
*
);
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
modules/access/mms/mmstu.c
View file @
2d824acd
...
...
@@ -912,14 +912,14 @@ static void MMSClose( access_t *p_access )
net_Close
(
p_sys
->
i_handle_udp
);
}
FREE
(
p_sys
->
p_cmd
);
FREE
(
p_sys
->
p_media
);
FREE
(
p_sys
->
p_header
);
FREE
(
p_sys
->
psz_server_version
);
FREE
(
p_sys
->
psz_tool_version
);
FREE
(
p_sys
->
psz_update_player_url
);
FREE
(
p_sys
->
psz_encryption_type
);
FREE
NULL
(
p_sys
->
p_cmd
);
FREE
NULL
(
p_sys
->
p_media
);
FREE
NULL
(
p_sys
->
p_header
);
FREE
NULL
(
p_sys
->
psz_server_version
);
FREE
NULL
(
p_sys
->
psz_tool_version
);
FREE
NULL
(
p_sys
->
psz_update_player_url
);
FREE
NULL
(
p_sys
->
psz_encryption_type
);
}
/****************************************************************************
...
...
@@ -1271,7 +1271,7 @@ static int mms_ParsePacket( access_t *p_access,
}
else
{
FREE
(
p_sys
->
p_media
);
FREE
NULL
(
p_sys
->
p_media
);
p_sys
->
p_media
=
p_packet
;
p_sys
->
i_media
=
i_packet_length
-
8
;
p_sys
->
i_media_used
=
0
;
...
...
modules/access/vcdx/access.c
View file @
2d824acd
...
...
@@ -44,8 +44,6 @@
#include
"info.h"
#include
"intf.h"
#define FREE_AND_NULL(ptr) free(ptr); ptr = NULL;
extern
void
VCDSetOrigin
(
access_t
*
p_access
,
lsn_t
i_lsn
,
track_t
i_track
,
const
vcdinfo_itemid_t
*
p_itemid
);
...
...
@@ -1002,14 +1000,14 @@ VCDClose ( vlc_object_t *p_this )
if
(
p_vcdplayer
->
p_input
)
vlc_object_release
(
p_vcdplayer
->
p_input
);
FREE
_AND_
NULL
(
p_vcdplayer
->
p_entries
);
FREE
_AND_
NULL
(
p_vcdplayer
->
p_segments
);
FREE
_AND_
NULL
(
p_vcdplayer
->
psz_source
);
FREE
_AND_
NULL
(
p_vcdplayer
->
track
);
FREE
_AND_
NULL
(
p_vcdplayer
->
segment
);
FREE
_AND_
NULL
(
p_vcdplayer
->
entry
);
FREE
_AND_
NULL
(
p_access
->
psz_demux
);
FREE
_AND_
NULL
(
p_vcdplayer
);
FREENULL
(
p_vcdplayer
->
p_entries
);
FREENULL
(
p_vcdplayer
->
p_segments
);
FREENULL
(
p_vcdplayer
->
psz_source
);
FREENULL
(
p_vcdplayer
->
track
);
FREENULL
(
p_vcdplayer
->
segment
);
FREENULL
(
p_vcdplayer
->
entry
);
FREENULL
(
p_access
->
psz_demux
);
FREENULL
(
p_vcdplayer
);
p_vcd_access
=
NULL
;
}
...
...
modules/access_output/http.c
View file @
2d824acd
...
...
@@ -44,8 +44,6 @@
#include
"vlc_httpd.h"
#define FREE( p ) if( p ) { free( p); (p) = NULL; }
#define DEFAULT_PORT 8080
#define DEFAULT_SSL_PORT 8443
...
...
modules/codec/cinepak.c
View file @
2d824acd
...
...
@@ -225,9 +225,6 @@ static void CloseDecoder( vlc_object_t *p_this )
#define GET4BYTES( p ) \
GetDWBE( p ); p+= 4;
#define FREE( p ) \
if( p ) free( p )
static
void
cinepak_LoadCodebook
(
cinepak_codebook_t
*
p_codebook
,
uint8_t
*
p_data
,
int
b_grayscale
)
{
...
...
modules/demux/asf/libasf.c
View file @
2d824acd
...
...
@@ -32,9 +32,6 @@
#define ASF_DEBUG 1
#define FREE( p ) \
if( p ) {free( p ); p = NULL; }
#define GUID_FMT "0x%x-0x%x-0x%x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
#define GUID_PRINT( guid ) \
(guid).v1, \
...
...
@@ -243,7 +240,7 @@ static void ASF_FreeObject_Index( asf_object_t *p_obj )
{
asf_object_index_t
*
p_index
=
(
asf_object_index_t
*
)
p_obj
;
FREE
(
p_index
->
index_entry
);
FREE
NULL
(
p_index
->
index_entry
);
}
static
int
ASF_ReadObject_file_properties
(
stream_t
*
s
,
asf_object_t
*
p_obj
)
...
...
@@ -485,7 +482,7 @@ static void ASF_FreeObject_header_extension( asf_object_t *p_obj )
asf_object_header_extension_t
*
p_he
=
(
asf_object_header_extension_t
*
)
p_obj
;
FREE
(
p_he
->
p_header_extension_data
);
FREE
NULL
(
p_he
->
p_header_extension_data
);
}
static
int
ASF_ReadObject_stream_properties
(
stream_t
*
s
,
asf_object_t
*
p_obj
)
...
...
@@ -554,8 +551,8 @@ static void ASF_FreeObject_stream_properties( asf_object_t *p_obj )
asf_object_stream_properties_t
*
p_sp
=
(
asf_object_stream_properties_t
*
)
p_obj
;
FREE
(
p_sp
->
p_type_specific_data
);
FREE
(
p_sp
->
p_error_correction_data
);
FREE
NULL
(
p_sp
->
p_type_specific_data
);
FREE
NULL
(
p_sp
->
p_error_correction_data
);
}
...
...
@@ -658,12 +655,12 @@ static void ASF_FreeObject_codec_list( asf_object_t *p_obj )
for
(
i_codec
=
0
;
i_codec
<
p_cl
->
i_codec_entries_count
;
i_codec
++
)
{
#define codec p_cl->codec[i_codec]
FREE
(
codec
.
psz_name
);
FREE
(
codec
.
psz_description
);
FREE
(
codec
.
p_information
);
FREE
NULL
(
codec
.
psz_name
);
FREE
NULL
(
codec
.
psz_description
);
FREE
NULL
(
codec
.
p_information
);
#undef codec
}
FREE
(
p_cl
->
codec
);
FREE
NULL
(
p_cl
->
codec
);
}
/* Microsoft should go to hell. This time the length give number of bytes
...
...
@@ -734,11 +731,11 @@ static void ASF_FreeObject_content_description( asf_object_t *p_obj)
asf_object_content_description_t
*
p_cd
=
(
asf_object_content_description_t
*
)
p_obj
;
FREE
(
p_cd
->
psz_title
);
FREE
(
p_cd
->
psz_author
);
FREE
(
p_cd
->
psz_copyright
);
FREE
(
p_cd
->
psz_description
);
FREE
(
p_cd
->
psz_rating
);
FREE
NULL
(
p_cd
->
psz_title
);
FREE
NULL
(
p_cd
->
psz_author
);
FREE
NULL
(
p_cd
->
psz_copyright
);
FREE
NULL
(
p_cd
->
psz_description
);
FREE
NULL
(
p_cd
->
psz_rating
);
}
/* Language list: */
...
...
@@ -795,8 +792,8 @@ static void ASF_FreeObject_language_list( asf_object_t *p_obj)
int
i
;
for
(
i
=
0
;
i
<
p_ll
->
i_language
;
i
++
)
FREE
(
p_ll
->
ppsz_language
[
i
]
);
FREE
(
p_ll
->
ppsz_language
);
FREE
NULL
(
p_ll
->
ppsz_language
[
i
]
);
FREE
NULL
(
p_ll
->
ppsz_language
);
}
/* Stream bitrate properties */
...
...
@@ -958,9 +955,9 @@ static void ASF_FreeObject_extended_stream_properties( asf_object_t *p_obj)
int
i
;
for
(
i
=
0
;
i
<
p_esp
->
i_stream_name_count
;
i
++
)
FREE
(
p_esp
->
ppsz_stream_name
[
i
]
);
FREE
(
p_esp
->
pi_stream_name_language
);
FREE
(
p_esp
->
ppsz_stream_name
);
FREE
NULL
(
p_esp
->
ppsz_stream_name
[
i
]
);
FREE
NULL
(
p_esp
->
pi_stream_name_language
);
FREE
NULL
(
p_esp
->
ppsz_stream_name
);
}
...
...
@@ -1002,7 +999,7 @@ static void ASF_FreeObject_advanced_mutual_exclusion( asf_object_t *p_obj)
asf_object_advanced_mutual_exclusion_t
*
p_ae
=
(
asf_object_advanced_mutual_exclusion_t
*
)
p_obj
;
FREE
(
p_ae
->
pi_stream_number
);
FREE
NULL
(
p_ae
->
pi_stream_number
);
}
...
...
@@ -1046,8 +1043,8 @@ static void ASF_FreeObject_stream_prioritization( asf_object_t *p_obj)
asf_object_stream_prioritization_t
*
p_sp
=
(
asf_object_stream_prioritization_t
*
)
p_obj
;
FREE
(
p_sp
->
pi_priority_stream_number
);
FREE
(
p_sp
->
pi_priority_flag
);
FREE
NULL
(
p_sp
->
pi_priority_stream_number
);
FREE
NULL
(
p_sp
->
pi_priority_flag
);
}
...
...
@@ -1153,8 +1150,8 @@ static void ASF_FreeObject_extended_content_description( asf_object_t *p_obj)
for
(
i
=
0
;
i
<
p_ec
->
i_count
;
i
++
)
{
FREE
(
p_ec
->
ppsz_name
[
i
]
);
FREE
(
p_ec
->
ppsz_value
[
i
]
);
FREE
NULL
(
p_ec
->
ppsz_name
[
i
]
);
FREE
NULL
(
p_ec
->
ppsz_value
[
i
]
);
}
}
...
...
modules/demux/avi/avi.c
View file @
2d824acd
...
...
@@ -80,7 +80,6 @@ static int Seek ( demux_t *, mtime_t, int );
static
int
Demux_Seekable
(
demux_t
*
);
static
int
Demux_UnSeekable
(
demux_t
*
);
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
#define __ABS( x ) ( (x) < 0 ? (-(x)) : (x) )
typedef
struct
...
...
@@ -651,11 +650,11 @@ static void Close ( vlc_object_t * p_this )
{
if
(
p_sys
->
track
[
i
]
)
{
FREE
(
p_sys
->
track
[
i
]
->
p_index
);
FREE
NULL
(
p_sys
->
track
[
i
]
->
p_index
);
free
(
p_sys
->
track
[
i
]
);
}
}
FREE
(
p_sys
->
track
);
FREE
NULL
(
p_sys
->
track
);
AVI_ChunkFreeRoot
(
p_demux
->
s
,
&
p_sys
->
ck_root
);
vlc_meta_Delete
(
p_sys
->
meta
);
...
...
modules/demux/mp4/libmp4.c
View file @
2d824acd
...
...
@@ -108,10 +108,6 @@
} \
return( i_code )
#define FREE( p ) \
if( p ) {free( p ); p = NULL; }
/* Some assumptions:
* The input method HAVE to be seekable
...
...
@@ -376,7 +372,7 @@ static int MP4_ReadBox_ftyp( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_ftyp
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_ftyp
->
i_compatible_brands
);
FREE
NULL
(
p_box
->
data
.
p_ftyp
->
i_compatible_brands
);
}
...
...
@@ -619,7 +615,7 @@ static int MP4_ReadBox_hdlr( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_hdlr
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_hdlr
->
psz_name
);
FREE
NULL
(
p_box
->
data
.
p_hdlr
->
psz_name
);
}
static
int
MP4_ReadBox_vmhd
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -708,7 +704,7 @@ static int MP4_ReadBox_url( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_url
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_url
->
psz_location
)
FREE
NULL
(
p_box
->
data
.
p_url
->
psz_location
)
}
static
int
MP4_ReadBox_urn
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -729,8 +725,8 @@ static int MP4_ReadBox_urn( stream_t *p_stream, MP4_Box_t *p_box )
}
static
void
MP4_FreeBox_urn
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_urn
->
psz_name
);
FREE
(
p_box
->
data
.
p_urn
->
psz_location
);
FREE
NULL
(
p_box
->
data
.
p_urn
->
psz_name
);
FREE
NULL
(
p_box
->
data
.
p_urn
->
psz_location
);
}
...
...
@@ -783,8 +779,8 @@ static int MP4_ReadBox_stts( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stts
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_stts
->
i_sample_count
);
FREE
(
p_box
->
data
.
p_stts
->
i_sample_delta
);
FREE
NULL
(
p_box
->
data
.
p_stts
->
i_sample_count
);
FREE
NULL
(
p_box
->
data
.
p_stts
->
i_sample_delta
);
}
static
int
MP4_ReadBox_ctts
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -817,8 +813,8 @@ static int MP4_ReadBox_ctts( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_ctts
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_ctts
->
i_sample_count
);
FREE
(
p_box
->
data
.
p_ctts
->
i_sample_offset
);
FREE
NULL
(
p_box
->
data
.
p_ctts
->
i_sample_count
);
FREE
NULL
(
p_box
->
data
.
p_ctts
->
i_sample_offset
);
}
static
int
MP4_ReadLengthDescriptor
(
uint8_t
**
pp_peek
,
int64_t
*
i_read
)
...
...
@@ -941,12 +937,12 @@ static int MP4_ReadBox_esds( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_esds
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_esds
->
es_descriptor
.
psz_URL
);
FREE
NULL
(
p_box
->
data
.
p_esds
->
es_descriptor
.
psz_URL
);
if
(
p_box
->
data
.
p_esds
->
es_descriptor
.
p_decConfigDescr
)
{
FREE
(
p_box
->
data
.
p_esds
->
es_descriptor
.
p_decConfigDescr
->
p_decoder_specific_info
);
FREE
NULL
(
p_box
->
data
.
p_esds
->
es_descriptor
.
p_decConfigDescr
->
p_decoder_specific_info
);
}
FREE
(
p_box
->
data
.
p_esds
->
es_descriptor
.
p_decConfigDescr
);
FREE
NULL
(
p_box
->
data
.
p_esds
->
es_descriptor
.
p_decConfigDescr
);
}
static
int
MP4_ReadBox_avcC
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1033,14 +1029,14 @@ static void MP4_FreeBox_avcC( MP4_Box_t *p_box )
for
(
i
=
0
;
i
<
p_avcC
->
i_sps
;
i
++
)
{
FREE
(
p_avcC
->
sps
[
i
]
);
FREE
NULL
(
p_avcC
->
sps
[
i
]
);
}
for
(
i
=
0
;
i
<
p_avcC
->
i_pps
;
i
++
)
{
FREE
(
p_avcC
->
pps
[
i
]
);
FREE
NULL
(
p_avcC
->
pps
[
i
]
);
}
if
(
p_avcC
->
i_sps
>
0
)
FREE
(
p_avcC
->
sps
);
if
(
p_avcC
->
i_pps
>
0
)
FREE
(
p_avcC
->
pps
);
if
(
p_avcC
->
i_sps
>
0
)
FREE
NULL
(
p_avcC
->
sps
);
if
(
p_avcC
->
i_pps
>
0
)
FREE
NULL
(
p_avcC
->
pps
);
}
static
int
MP4_ReadBox_sample_soun
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1192,7 +1188,7 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_sample_soun
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
);
FREE
NULL
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
);
if
(
p_box
->
i_type
==
FOURCC_drms
)
{
...
...
@@ -1271,7 +1267,7 @@ int MP4_ReadBox_sample_vide( stream_t *p_stream, MP4_Box_t *p_box )
void
MP4_FreeBox_sample_vide
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_sample_vide
->
p_qt_image_description
);
FREE
NULL
(
p_box
->
data
.
p_sample_vide
->
p_qt_image_description
);
}
static
int
MP4_ReadBox_sample_mp4s
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1368,7 +1364,7 @@ static int MP4_ReadBox_sample_tx3g( stream_t *p_stream, MP4_Box_t *p_box )
/* We can't easily call it, and anyway ~ 20 bytes lost isn't a real problem */
static void MP4_FreeBox_sample_text( MP4_Box_t *p_box )
{
FREE( p_box->data.p_sample_text->psz_text_name );
FREE
NULL
( p_box->data.p_sample_text->psz_text_name );
}
#endif
...
...
@@ -1429,7 +1425,7 @@ static int MP4_ReadBox_stsz( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stsz
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_stsz
->
i_entry_size
);
FREE
NULL
(
p_box
->
data
.
p_stsz
->
i_entry_size
);
}
static
int
MP4_ReadBox_stsc
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1466,9 +1462,9 @@ static int MP4_ReadBox_stsc( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stsc
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_stsc
->
i_first_chunk
);
FREE
(
p_box
->
data
.
p_stsc
->
i_samples_per_chunk
);
FREE
(
p_box
->
data
.
p_stsc
->
i_sample_description_index
);
FREE
NULL
(
p_box
->
data
.
p_stsc
->
i_first_chunk
);
FREE
NULL
(
p_box
->
data
.
p_stsc
->
i_samples_per_chunk
);
FREE
NULL
(
p_box
->
data
.
p_stsc
->
i_sample_description_index
);
}
static
int
MP4_ReadBox_stco_co64
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1514,7 +1510,7 @@ static int MP4_ReadBox_stco_co64( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stco_co64
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_co64
->
i_chunk_offset
);
FREE
NULL
(
p_box
->
data
.
p_co64
->
i_chunk_offset
);
}
static
int
MP4_ReadBox_stss
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1548,7 +1544,7 @@ static int MP4_ReadBox_stss( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stss
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_stss
->
i_sample_number
)
FREE
NULL
(
p_box
->
data
.
p_stss
->
i_sample_number
)
}
static
int
MP4_ReadBox_stsh
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1585,8 +1581,8 @@ static int MP4_ReadBox_stsh( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stsh
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_stsh
->
i_shadowed_sample_number
)
FREE
(
p_box
->
data
.
p_stsh
->
i_sync_sample_number
)
FREE
NULL
(
p_box
->
data
.
p_stsh
->
i_shadowed_sample_number
)
FREE
NULL
(
p_box
->
data
.
p_stsh
->
i_sync_sample_number
)
}
...
...
@@ -1617,7 +1613,7 @@ static int MP4_ReadBox_stdp( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_stdp
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_stdp
->
i_priority
)
FREE
NULL
(
p_box
->
data
.
p_stdp
->
i_priority
)
}
static
int
MP4_ReadBox_padb
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1661,10 +1657,10 @@ static int MP4_ReadBox_padb( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_padb
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_padb
->
i_reserved1
);
FREE
(
p_box
->
data
.
p_padb
->
i_pad2
);
FREE
(
p_box
->
data
.
p_padb
->
i_reserved2
);
FREE
(
p_box
->
data
.
p_padb
->
i_pad1
);
FREE
NULL
(
p_box
->
data
.
p_padb
->
i_reserved1
);
FREE
NULL
(
p_box
->
data
.
p_padb
->
i_pad2
);
FREE
NULL
(
p_box
->
data
.
p_padb
->
i_reserved2
);
FREE
NULL
(
p_box
->
data
.
p_padb
->
i_pad1
);
}
static
int
MP4_ReadBox_elst
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1720,10 +1716,10 @@ static int MP4_ReadBox_elst( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_elst
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_elst
->
i_segment_duration
);
FREE
(
p_box
->
data
.
p_elst
->
i_media_time
);
FREE
(
p_box
->
data
.
p_elst
->
i_media_rate_integer
);
FREE
(
p_box
->
data
.
p_elst
->
i_media_rate_fraction
);
FREE
NULL
(
p_box
->
data
.
p_elst
->
i_segment_duration
);
FREE
NULL
(
p_box
->
data
.
p_elst
->
i_media_time
);
FREE
NULL
(
p_box
->
data
.
p_elst
->
i_media_rate_integer
);
FREE
NULL
(
p_box
->
data
.
p_elst
->
i_media_rate_fraction
);
}
static
int
MP4_ReadBox_cprt
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -1757,7 +1753,7 @@ static int MP4_ReadBox_cprt( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_cprt
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_cprt
->
psz_notice
);
FREE
NULL
(
p_box
->
data
.
p_cprt
->
psz_notice
);
}
...
...
@@ -1804,7 +1800,7 @@ static int MP4_ReadBox_cmvd( stream_t *p_stream, MP4_Box_t *p_box )
}
static
void
MP4_FreeBox_cmvd
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_cmvd
->
p_data
);
FREE
NULL
(
p_box
->
data
.
p_cmvd
->
p_data
);
}
...
...
@@ -1967,7 +1963,7 @@ static int MP4_ReadBox_rdrf( stream_t *p_stream, MP4_Box_t *p_box )
static
void
MP4_FreeBox_rdrf
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_rdrf
->
psz_ref
)
FREE
NULL
(
p_box
->
data
.
p_rdrf
->
psz_ref
)
}
...
...
@@ -2105,7 +2101,7 @@ static int MP4_ReadBox_0xa9xxx( stream_t *p_stream, MP4_Box_t *p_box )
}
static
void
MP4_FreeBox_0xa9xxx
(
MP4_Box_t
*
p_box
)
{
FREE
(
p_box
->
data
.
p_0xa9xxx
->
psz_text
);
FREE
NULL
(
p_box
->
data
.
p_0xa9xxx
->
psz_text
);
}
/* For generic */
...
...
@@ -2606,7 +2602,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
if
(
!
psz_path
||
!
psz_path
[
0
]
)
{
FREE
(
psz_path
);
FREE
NULL
(
psz_path
);
*
pp_result
=
NULL
;
return
;
}
...
...
@@ -2623,7 +2619,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
// psz_path,psz_token,i_number );
if
(
!
psz_token
)
{
FREE
(
psz_token
);
FREE
NULL
(
psz_token
);
free
(
psz_fmt
);
*
pp_result
=
p_box
;
return
;
...
...
@@ -2712,7 +2708,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
else
{
// fprintf( stderr, "Argg malformed token \"%s\"",psz_token );
FREE
(
psz_token
);
FREE
NULL
(
psz_token
);
free
(
psz_fmt
);
*
pp_result
=
NULL
;
return
;
...
...
modules/demux/mp4/mp4.c
View file @
2d824acd
...
...
@@ -245,8 +245,6 @@ static inline int64_t MP4_GetMoviePTS(demux_sys_t *p_sys )
static
vlc_bool_t
FindItem
(
demux_t
*
p_demux
,
playlist_t
*
p_playlist
,
playlist_item_t
**
pp_item
);
#define FREE( p ) if( p ) { free( p ); (p) = NULL;}
/*****************************************************************************
* Open: check file and initializes MP4 structures
*****************************************************************************/
...
...
@@ -879,7 +877,7 @@ static void Close ( vlc_object_t * p_this )
{
MP4_TrackDestroy
(
p_demux
,
&
p_sys
->
track
[
i_track
]
);
}
FREE
(
p_sys
->
track
);
FREE
NULL
(
p_sys
->
track
);
free
(
p_sys
);
}
...
...
@@ -1904,18 +1902,18 @@ static void MP4_TrackDestroy( demux_t *p_demux, mp4_track_t *p_track )
{
if
(
p_track
->
chunk
)
{
FREE
(
p_track
->
chunk
[
i_chunk
].
p_sample_count_dts
);
FREE
(
p_track
->
chunk
[
i_chunk
].
p_sample_delta_dts
);
FREE
NULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_count_dts
);
FREE
NULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_delta_dts
);
FREE
(
p_track
->
chunk
[
i_chunk
].
p_sample_count_pts
);
FREE
(
p_track
->
chunk
[
i_chunk
].
p_sample_offset_pts
);
FREE
NULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_count_pts
);
FREE
NULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_offset_pts
);
}
}
FREE
(
p_track
->
chunk
);
FREE
NULL
(
p_track
->
chunk
);
if
(
!
p_track
->
i_sample_size
)
{
FREE
(
p_track
->
p_sample_size
);
FREE
NULL
(
p_track
->
p_sample_size
);
}