Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
2d824acd
Commit
2d824acd
authored
Aug 03, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate definitions of FREE
parent
c17969a0
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
211 additions
and
276 deletions
+211
-276
modules/access/dvb/dvb.h
modules/access/dvb/dvb.h
+7
-12
modules/access/dvb/http.c
modules/access/dvb/http.c
+0
-6
modules/access/mms/mms.h
modules/access/mms/mms.h
+0
-2
modules/access/mms/mmstu.c
modules/access/mms/mmstu.c
+9
-9
modules/access/vcdx/access.c
modules/access/vcdx/access.c
+8
-10
modules/access_output/http.c
modules/access_output/http.c
+0
-2
modules/codec/cinepak.c
modules/codec/cinepak.c
+0
-3
modules/demux/asf/libasf.c
modules/demux/asf/libasf.c
+23
-26
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+2
-3
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+43
-47
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+7
-9
modules/demux/playlist/asx.c
modules/demux/playlist/asx.c
+13
-15
modules/demux/playlist/b4s.c
modules/demux/playlist/b4s.c
+6
-8
modules/demux/playlist/qtl.c
modules/demux/playlist/qtl.c
+0
-2
modules/demux/playlist/shoutcast.c
modules/demux/playlist/shoutcast.c
+16
-18
modules/gui/wxwidgets/dialogs/interaction.cpp
modules/gui/wxwidgets/dialogs/interaction.cpp
+2
-6
modules/mux/ogg.c
modules/mux/ogg.c
+12
-13
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+27
-30
modules/stream_out/es.c
modules/stream_out/es.c
+0
-2
modules/video_filter/logo.c
modules/video_filter/logo.c
+2
-4
modules/video_output/image.c
modules/video_output/image.c
+5
-7
src/misc/vlm.c
src/misc/vlm.c
+6
-9
src/stream_output/announce.c
src/stream_output/announce.c
+4
-10
src/stream_output/sap.c
src/stream_output/sap.c
+7
-9
src/stream_output/stream_output.c
src/stream_output/stream_output.c
+12
-14
No files found.
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
);
}
}
...
...
modules/demux/playlist/asx.c
View file @
2d824acd
...
...
@@ -37,8 +37,6 @@
#include "playlist.h"
#include "vlc_meta.h"
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
struct
demux_sys_t
{
char
*
psz_prefix
;
...
...
@@ -373,12 +371,12 @@ static int Demux( demux_t *p_demux )
continue
;
}
/* cleanup entry */
FREE
(
psz_title_entry
)
FREE
(
psz_base_entry
)
FREE
(
psz_author_entry
)
FREE
(
psz_copyright_entry
)
FREE
(
psz_moreinfo_entry
)
FREE
(
psz_abstract_entry
)
FREE
NULL
(
psz_title_entry
)
FREE
NULL
(
psz_base_entry
)
FREE
NULL
(
psz_author_entry
)
FREE
NULL
(
psz_copyright_entry
)
FREE
NULL
(
psz_moreinfo_entry
)
FREE
NULL
(
psz_abstract_entry
)
b_entry
=
VLC_FALSE
;
}
else
if
(
!
strncasecmp
(
psz_parse
,
"<Entry>"
,
7
)
)
...
...
@@ -419,7 +417,7 @@ static int Demux( demux_t *p_demux )
/* create the new entry */
asprintf
(
&
psz_name
,
"%d %s"
,
i_entry_count
,
(
psz_title_entry
?
psz_title_entry
:
p_current
->
p_input
->
psz_name
)
);
p_entry
=
input_ItemNew
(
p_playlist
,
psz_string
,
psz_name
);
FREE
(
psz_name
);
FREE
NULL
(
psz_name
);
vlc_input_item_CopyOptions
(
p_current
->
p_input
,
p_entry
);
p_entry
->
p_meta
=
vlc_meta_New
();
...
...
@@ -452,12 +450,12 @@ static int Demux( demux_t *p_demux )
if
(
psz_moreinfo_asx
)
vlc_meta_SetURL
(
p_current
->
p_input
->
p_meta
,
psz_moreinfo_asx
);
if
(
psz_abstract_asx
)
vlc_meta_SetDescription
(
p_current
->
p_input
->
p_meta
,
psz_abstract_asx
);
vlc_mutex_unlock
(
&
p_current
->
p_input
->
lock
);
FREE
(
psz_base_asx
);
FREE
(
psz_title_asx
);
FREE
(
psz_author_asx
);
FREE
(
psz_copyright_asx
);
FREE
(
psz_moreinfo_asx
);
FREE
(
psz_abstract_asx
);
FREE
NULL
(
psz_base_asx
);
FREE
NULL
(
psz_title_asx
);
FREE
NULL
(
psz_author_asx
);
FREE
NULL
(
psz_copyright_asx
);
FREE
NULL
(
psz_moreinfo_asx
);
FREE
NULL
(
psz_abstract_asx
);
psz_parse
++
;
}
else
psz_parse
++
;
...
...
modules/demux/playlist/b4s.c
View file @
2d824acd
...
...
@@ -269,14 +269,12 @@ static int Demux( demux_t *p_demux )
p_item_in_category
,
(
i_parent_id
>
0
)
?
VLC_TRUE
:
VLC_FALSE
,
PLAYLIST_APPEND
);
#define FREE(a) if( a ) free( a ); a = NULL;
FREE
(
psz_name
);
FREE
(
psz_mrl
);
FREE
(
psz_genre
);
FREE
(
psz_bitrate
);
FREE
(
psz_listeners
);
FREE
(
psz_now
);
#undef FREE
FREENULL
(
psz_name
);
FREENULL
(
psz_mrl
);
FREENULL
(
psz_genre
);
FREENULL
(
psz_bitrate
);
FREENULL
(
psz_listeners
);
FREENULL
(
psz_now
);
}
free
(
psz_elname
);
psz_elname
=
strdup
(
""
);
...
...
modules/demux/playlist/qtl.c
View file @
2d824acd
...
...
@@ -113,8 +113,6 @@ void E_(Close_QTL)( vlc_object_t *p_this )
free
(
p_sys
);
}
#define FREE( a ) if( a ) free( a );
static
int
Demux
(
demux_t
*
p_demux
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
...
...
modules/demux/playlist/shoutcast.c
View file @
2d824acd
...
...
@@ -174,7 +174,6 @@ static int DemuxGenre( demux_t *p_demux )
char
*
psz_eltname
=
NULL
;
/* tag name */
input_item_t
*
p_input
;
#define FREE(a) if( a ) free( a ); a = NULL;
while
(
xml_ReaderRead
(
p_sys
->
p_xml_reader
)
==
1
)
{
int
i_type
;
...
...
@@ -203,8 +202,8 @@ static int DemuxGenre( demux_t *p_demux )
xml_ReaderValue
(
p_sys
->
p_xml_reader
);
if
(
!
psz_attrname
||
!
psz_attrvalue
)
{
FREE
(
psz_attrname
);
FREE
(
psz_attrvalue
);
FREE
NULL
(
psz_attrname
);
FREE
NULL
(
psz_attrvalue
);
free
(
psz_eltname
);
/*FIXME: isn't return a bit too much. what about break*/
return
-
1
;
...
...
@@ -247,9 +246,9 @@ static int DemuxGenre( demux_t *p_demux )
p_sys
->
p_current
,
p_sys
->
p_item_in_category
,
(
p_sys
->
i_parent_id
>
0
)
?
VLC_TRUE
:
VLC_FALSE
,
PLAYLIST_APPEND
);
FREE
(
psz_name
);
FREE
NULL
(
psz_name
);
}
FREE
(
psz_eltname
);
FREE
NULL
(
psz_eltname
);
break
;
}
}
...
...
@@ -331,8 +330,8 @@ static int DemuxStation( demux_t *p_demux )
if
(
!
psz_attrname
||
!
psz_attrvalue
)
{
free
(
psz_eltname
);
FREE
(
psz_attrname
);
FREE
(
psz_attrvalue
);
FREE
NULL
(
psz_attrname
);
FREE
NULL
(
psz_attrvalue
);
return
-
1
;
}
...
...
@@ -357,8 +356,8 @@ static int DemuxStation( demux_t *p_demux )
if
(
!
psz_attrname
||
!
psz_attrvalue
)
{
free
(
psz_eltname
);
FREE
(
psz_attrname
);
FREE
(
psz_attrvalue
);
FREE
NULL
(
psz_attrname
);
FREE
NULL
(
psz_attrvalue
);
return
-
1
;
}
...
...
@@ -441,14 +440,14 @@ static int DemuxStation( demux_t *p_demux )
(
p_sys
->
i_parent_id
>
0
)
?
VLC_TRUE
:
VLC_FALSE
,
PLAYLIST_APPEND
);
FREE
(
psz_name
);
FREE
(
psz_mt
)
FREE
(
psz_id
)
FREE
(
psz_br
)
FREE
(
psz_genre
)
FREE
(
psz_ct
)
FREE
(
psz_lc
)
FREE
(
psz_rt
)
FREE
NULL
(
psz_name
);
FREE
NULL
(
psz_mt
)
FREE
NULL
(
psz_id
)
FREE
NULL
(
psz_br
)
FREE
NULL
(
psz_genre
)
FREE
NULL
(
psz_ct
)
FREE
NULL
(
psz_lc
)
FREE
NULL
(
psz_rt
)
}
free
(
psz_eltname
);
break
;
...
...
@@ -456,7 +455,6 @@ static int DemuxStation( demux_t *p_demux )
}
return
0
;
}
#undef FREE
static
int
Control
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
...
...
modules/gui/wxwidgets/dialogs/interaction.cpp
View file @
2d824acd
...
...
@@ -28,8 +28,6 @@
#include <wx/statline.h>
#define FREE( i ) { if( i ) free( i ); i = NULL; }
/*****************************************************************************
* Event Table.
*****************************************************************************/
...
...
@@ -236,8 +234,8 @@ void InteractionDialog::OnClear( wxCommandEvent& event )
for
(
i
=
p_dialog
->
i_widgets
-
1
;
i
>=
0
;
i
--
)
{
user_widget_t
*
p_widget
=
p_dialog
->
pp_widgets
[
i
];
FREE
(
p_widget
->
psz_text
);
FREE
(
p_widget
->
val
.
psz_string
);
FREE
NULL
(
p_widget
->
psz_text
);
FREE
NULL
(
p_widget
->
val
.
psz_string
);
REMOVE_ELEM
(
p_dialog
->
pp_widgets
,
p_dialog
->
i_widgets
,
i
);
free
(
p_widget
);
}
...
...
@@ -271,5 +269,3 @@ void InteractionDialog::Finish( int i_ret )
p_dialog
->
i_return
=
i_ret
;
vlc_mutex_unlock
(
&
p_dialog
->
p_interaction
->
object_lock
);
}
#undef FREE
modules/mux/ogg.c
View file @
2d824acd
...
...
@@ -72,7 +72,6 @@ static block_t *OggCreateFooter( sout_mux_t *, mtime_t );
/*****************************************************************************
* Misc declarations
*****************************************************************************/
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
/* Structures used for OggDS headers used in ogm files */
...
...
@@ -263,10 +262,10 @@ static void Close( vlc_object_t * p_this )
{
i_dts
=
p_sys
->
pp_del_streams
[
i
]
->
i_dts
;
ogg_stream_clear
(
&
p_sys
->
pp_del_streams
[
i
]
->
os
);
FREE
(
p_sys
->
pp_del_streams
[
i
]
->
p_oggds_header
);
FREE
(
p_sys
->
pp_del_streams
[
i
]
);
FREE
NULL
(
p_sys
->
pp_del_streams
[
i
]
->
p_oggds_header
);
FREE
NULL
(
p_sys
->
pp_del_streams
[
i
]
);
}
FREE
(
p_sys
->
pp_del_streams
);
FREE
NULL
(
p_sys
->
pp_del_streams
);
p_sys
->
i_streams
-=
p_sys
->
i_del_streams
;
/* Write footer */
...
...
@@ -387,7 +386,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
default:
FREE
(
p_input
->
p_sys
);
FREE
NULL
(
p_input
->
p_sys
);
return
VLC_EGENERIC
;
}
break
;
...
...
@@ -411,7 +410,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
fourcc_to_wf_tag
(
p_stream
->
i_fourcc
,
&
i_tag
);
if
(
i_tag
==
WAVE_FORMAT_UNKNOWN
)
{
FREE
(
p_input
->
p_sys
);
FREE
NULL
(
p_input
->
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -465,12 +464,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
default:
FREE
(
p_input
->
p_sys
);
FREE
NULL
(
p_input
->
p_sys
);
return
VLC_EGENERIC
;
}
break
;
default:
FREE
(
p_input
->
p_sys
);
FREE
NULL
(
p_input
->
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -518,8 +517,8 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
else
{
/* wasn't already added so get rid of it */
FREE
(
p_stream
->
p_oggds_header
);
FREE
(
p_stream
);
FREE
NULL
(
p_stream
->
p_oggds_header
);
FREE
NULL
(
p_stream
);
p_sys
->
i_add_streams
--
;
}
}
...
...
@@ -890,10 +889,10 @@ static int Mux( sout_mux_t *p_mux )
/* Remove deleted logical streams */
for
(
i
=
0
;
i
<
p_sys
->
i_del_streams
;
i
++
)
{
FREE
(
p_sys
->
pp_del_streams
[
i
]
->
p_oggds_header
);
FREE
(
p_sys
->
pp_del_streams
[
i
]
);
FREE
NULL
(
p_sys
->
pp_del_streams
[
i
]
->
p_oggds_header
);
FREE
NULL
(
p_sys
->
pp_del_streams
[
i
]
);
}
FREE
(
p_sys
->
pp_del_streams
);
FREE
NULL
(
p_sys
->
pp_del_streams
);
p_sys
->
i_streams
=
0
;
}
...
...
modules/services_discovery/sap.c
View file @
2d824acd
...
...
@@ -272,9 +272,6 @@ struct demux_sys_t
#endif
static
void
FreeSDP
(
sdp_t
*
p_sdp
);
#define FREE( p ) \
if( p ) { free( p ); (p) = NULL; }
/*****************************************************************************
* Open: initialize and create stuff
*****************************************************************************/
...
...
@@ -411,11 +408,11 @@ static int OpenDemux( vlc_object_t *p_this )
p_demux
->
pf_control
=
Control
;
p_demux
->
pf_demux
=
Demux
;
FREE
(
psz_sdp
);
FREE
NULL
(
psz_sdp
);
return
VLC_SUCCESS
;
error:
FREE
(
psz_sdp
);
FREE
NULL
(
psz_sdp
);
if
(
p_sdp
)
FreeSDP
(
p_sdp
);
p_sdp
=
NULL
;
stream_Seek
(
p_demux
->
s
,
0
);
return
VLC_EGENERIC
;
...
...
@@ -435,7 +432,7 @@ static void Close( vlc_object_t *p_this )
{
net_Close
(
p_sys
->
pi_fd
[
i
]
);
}
FREE
(
p_sys
->
pi_fd
);
FREE
NULL
(
p_sys
->
pi_fd
);
#if 0
if( config_GetInt( p_sd, "sap-cache" ) )
...
...
@@ -448,7 +445,7 @@ static void Close( vlc_object_t *p_this )
{
RemoveAnnounce
(
p_sd
,
p_sys
->
pp_announces
[
i
]
);
}
FREE
(
p_sys
->
pp_announces
);
FREE
NULL
(
p_sys
->
pp_announces
);
if
(
p_sys
->
p_playlist
)
{
...
...
@@ -593,9 +590,9 @@ static int Demux( demux_t *p_demux )
p_parent_input
=
p_input
->
input
.
p_item
;
vlc_mutex_lock
(
&
p_parent_input
->
lock
);
FREE
(
p_parent_input
->
psz_uri
);
FREE
NULL
(
p_parent_input
->
psz_uri
);
p_parent_input
->
psz_uri
=
strdup
(
p_sdp
->
psz_uri
);
FREE
(
p_parent_input
->
psz_name
);
FREE
NULL
(
p_parent_input
->
psz_name
);
p_parent_input
->
psz_name
=
strdup
(
EnsureUTF8
(
p_sdp
->
psz_sessionname
)
);
p_parent_input
->
i_type
=
ITEM_TYPE_NET
;
...
...
@@ -802,7 +799,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
CreateAnnounce
(
p_sd
,
i_hash
,
p_sdp
);
FREE
(
p_decompressed_buffer
);
FREE
NULL
(
p_decompressed_buffer
);
return
VLC_SUCCESS
;
}
...
...
@@ -993,7 +990,7 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
strncmp
(
psz_parse
,
"video"
,
5
)
)
{
msg_Warn
(
p_obj
,
"unhandled media type -%s-"
,
psz_parse
);
FREE
(
psz_uri
);
FREE
NULL
(
psz_uri
);
return
VLC_EGENERIC
;
}
...
...
@@ -1002,7 +999,7 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
else
{
msg_Warn
(
p_obj
,
"unable to parse m field (1)"
);
FREE
(
psz_uri
);
FREE
NULL
(
psz_uri
);
return
VLC_EGENERIC
;
}
...
...
@@ -1025,7 +1022,7 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
else
{
msg_Warn
(
p_obj
,
"unable to parse m field (2)"
);
FREE
(
psz_uri
);
FREE
NULL
(
psz_uri
);
return
VLC_EGENERIC
;
}
...
...
@@ -1075,8 +1072,8 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
asprintf
(
&
p_sdp
->
psz_uri
,
"%s://%s@%s:%i"
,
psz_proto
,
psz_source
,
psz_uri
,
i_port
);
FREE
(
psz_uri
);
FREE
(
psz_proto
);
FREE
NULL
(
psz_uri
);
FREE
NULL
(
psz_proto
);
return
VLC_SUCCESS
;
}
...
...
@@ -1200,10 +1197,10 @@ static sdp_t * ParseSDP( vlc_object_t *p_obj, char* psz_sdp )
p_sdp
->
i_session_id
=
atoll
(
psz_sess_id
);
FREE
(
psz_sess_id
);
FREE
NULL
(
psz_sess_id
);
GET_FIELD
(
psz_sess_id
);
FREE
(
psz_sess_id
);
FREE
NULL
(
psz_sess_id
);
GET_FIELD
(
p_sdp
->
psz_network_type
);
GET_FIELD
(
p_sdp
->
psz_address_type
);
...
...
@@ -1347,26 +1344,26 @@ static int Decompress( unsigned char *psz_src, unsigned char **_dst, int i_len )
static
void
FreeSDP
(
sdp_t
*
p_sdp
)
{
int
i
;
FREE
(
p_sdp
->
psz_sdp
);
FREE
(
p_sdp
->
psz_sessionname
);
FREE
(
p_sdp
->
psz_connection
);
FREE
(
p_sdp
->
psz_media
);
FREE
(
p_sdp
->
psz_uri
);
FREE
(
p_sdp
->
psz_username
);
FREE
(
p_sdp
->
psz_network_type
);
FREE
NULL
(
p_sdp
->
psz_sdp
);
FREE
NULL
(
p_sdp
->
psz_sessionname
);
FREE
NULL
(
p_sdp
->
psz_connection
);
FREE
NULL
(
p_sdp
->
psz_media
);
FREE
NULL
(
p_sdp
->
psz_uri
);
FREE
NULL
(
p_sdp
->
psz_username
);
FREE
NULL
(
p_sdp
->
psz_network_type
);
FREE
(
p_sdp
->
psz_address
);
FREE
(
p_sdp
->
psz_address_type
);
FREE
NULL
(
p_sdp
->
psz_address
);
FREE
NULL
(
p_sdp
->
psz_address_type
);
for
(
i
=
p_sdp
->
i_attributes
-
1
;
i
>=
0
;
i
--
)
{
struct
attribute_t
*
p_attr
=
p_sdp
->
pp_attributes
[
i
];
FREE
(
p_sdp
->
pp_attributes
[
i
]
->
psz_field
);
FREE
(
p_sdp
->
pp_attributes
[
i
]
->
psz_value
);
FREE
NULL
(
p_sdp
->
pp_attributes
[
i
]
->
psz_field
);
FREE
NULL
(
p_sdp
->
pp_attributes
[
i
]
->
psz_value
);
REMOVE_ELEM
(
p_sdp
->
pp_attributes
,
p_sdp
->
i_attributes
,
i
);
FREE
(
p_attr
);
FREE
NULL
(
p_attr
);
}
FREE
(
p_sdp
);
FREE
NULL
(
p_sdp
);
}
static
int
RemoveAnnounce
(
services_discovery_t
*
p_sd
,
...
...
modules/stream_out/es.c
View file @
2d824acd
...
...
@@ -102,8 +102,6 @@ vlc_module_begin();
set_callbacks
(
Open
,
Close
);
vlc_module_end
();
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
...
...
modules/video_filter/logo.c
View file @
2d824acd
...
...
@@ -257,15 +257,14 @@ void __LoadLogoList( vlc_object_t *p_this, logo_list_t *p_logo_list )
/*****************************************************************************
* FreeLogoList
*****************************************************************************/
#define FREE( a ) free(a);a=NULL;
void
FreeLogoList
(
logo_list_t
*
p_logo_list
)
{
unsigned
int
i
;
if
(
p_logo_list
->
psz_filename
)
FREE
(
p_logo_list
->
psz_filename
);
FREENULL
(
p_logo_list
->
psz_filename
);
for
(
i
=
0
;
i
<
p_logo_list
->
i_count
;
i
++
)
{
logo_t
*
p_logo
=
&
p_logo_list
->
p_logo
[
i
];
if
(
p_logo
[
i
].
psz_file
)
FREE
(
p_logo
[
i
].
psz_file
);
FREENULL
(
p_logo
[
i
].
psz_file
);
if
(
p_logo
[
i
].
p_pic
)
{
p_logo
[
i
].
p_pic
->
pf_release
(
p_logo
[
i
].
p_pic
);
...
...
@@ -273,7 +272,6 @@ void FreeLogoList( logo_list_t *p_logo_list )
}
}
}
#undef FREE
/*****************************************************************************
* vout_sys_t: logo video output method descriptor
...
...
modules/video_output/image.c
View file @
2d824acd
...
...
@@ -118,8 +118,6 @@ struct vout_sys_t
image_handler_t
*
p_image
;
};
#define FREE( p ) if( p ) { free( p ); p = NULL; }
/*****************************************************************************
* Create: allocates video thread
*****************************************************************************
...
...
@@ -152,8 +150,8 @@ static int Create( vlc_object_t *p_this )
if
(
!
p_vout
->
p_sys
->
p_image
)
{
msg_Err
(
p_this
,
"unable to create image handler"
)
;
FREE
(
p_vout
->
p_sys
->
psz_prefix
);
FREE
(
p_vout
->
p_sys
);
FREE
NULL
(
p_vout
->
p_sys
->
psz_prefix
);
FREE
NULL
(
p_vout
->
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -239,9 +237,9 @@ static void Destroy( vlc_object_t *p_this )
/* Destroy structure */
image_HandlerDelete
(
p_vout
->
p_sys
->
p_image
);
FREE
(
p_vout
->
p_sys
->
psz_prefix
);
FREE
(
p_vout
->
p_sys
->
psz_format
);
FREE
(
p_vout
->
p_sys
);
FREE
NULL
(
p_vout
->
p_sys
->
psz_prefix
);
FREE
NULL
(
p_vout
->
p_sys
->
psz_format
);
FREE
NULL
(
p_vout
->
p_sys
);
}
/*****************************************************************************
...
...
src/misc/vlm.c
View file @
2d824acd
...
...
@@ -45,9 +45,6 @@
#include <vlc_vod.h>
#include <charset.h>
#define FREE( p ) \
if( p ) { free( p ); (p) = NULL; }
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
...
...
@@ -158,11 +155,11 @@ void vlm_Delete( vlm_t *p_vlm )
vlc_mutex_destroy
(
&
p_vlm
->
lock
);
while
(
p_vlm
->
i_media
)
vlm_MediaDelete
(
p_vlm
,
p_vlm
->
media
[
0
],
NULL
);
FREE
(
p_vlm
->
media
);
FREE
NULL
(
p_vlm
->
media
);
while
(
p_vlm
->
i_schedule
)
vlm_ScheduleDelete
(
p_vlm
,
p_vlm
->
schedule
[
0
],
NULL
);
FREE
(
p_vlm
->
schedule
);
FREE
NULL
(
p_vlm
->
schedule
);
vlc_object_detach
(
p_vlm
);
vlc_object_destroy
(
p_vlm
);
...
...
@@ -833,8 +830,8 @@ static int ExecuteCommand( vlm_t *p_vlm, const char *psz_command,
}
success:
for
(
i
=
0
;
i
<
i_command
;
i
++
)
FREE
(
ppsz_command
[
i
]
);
FREE
(
ppsz_command
);
for
(
i
=
0
;
i
<
i_command
;
i
++
)
FREE
NULL
(
ppsz_command
[
i
]
);
FREE
NULL
(
ppsz_command
);
*
pp_message
=
p_message
;
return
VLC_SUCCESS
;
...
...
@@ -843,8 +840,8 @@ syntax_error:
p_message
=
vlm_MessageNew
(
ppsz_command
[
0
],
"Wrong command syntax"
);
error:
for
(
i
=
0
;
i
<
i_command
;
i
++
)
FREE
(
ppsz_command
[
i
]
);
FREE
(
ppsz_command
);
for
(
i
=
0
;
i
<
i_command
;
i
++
)
FREE
NULL
(
ppsz_command
[
i
]
);
FREE
NULL
(
ppsz_command
);
*
pp_message
=
p_message
;
return
VLC_EGENERIC
;
...
...
src/stream_output/announce.c
View file @
2d824acd
...
...
@@ -31,12 +31,6 @@
#include <vlc/vlc.h>
#include <vlc/sout.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
/****************************************************************************
* Sout-side functions
****************************************************************************/
...
...
@@ -183,10 +177,10 @@ void sout_AnnounceSessionDestroy( session_descriptor_t *p_session )
{
if
(
p_session
)
{
FREE
(
p_session
->
psz_name
);
FREE
(
p_session
->
psz_group
);
FREE
(
p_session
->
psz_uri
);
FREE
(
p_session
->
psz_sdp
);
FREE
NULL
(
p_session
->
psz_name
);
FREE
NULL
(
p_session
->
psz_group
);
FREE
NULL
(
p_session
->
psz_uri
);
FREE
NULL
(
p_session
->
psz_sdp
);
free
(
p_session
);
}
}
...
...
src/stream_output/sap.c
View file @
2d824acd
...
...
@@ -88,8 +88,6 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
static
int
announce_SAPAnnounceDel
(
sap_handler_t
*
p_sap
,
session_descriptor_t
*
p_session
);
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
/**
* Create the SAP handler
...
...
@@ -146,17 +144,17 @@ void announce_SAPHandlerDestroy( sap_handler_t *p_sap )
for
(
i
=
0
;
i
<
p_sap
->
i_sessions
;
i
++
)
{
sap_session_t
*
p_session
=
p_sap
->
pp_sessions
[
i
];
FREE
(
p_session
->
psz_sdp
);
FREE
(
p_session
->
psz_data
);
FREE
NULL
(
p_session
->
psz_sdp
);
FREE
NULL
(
p_session
->
psz_data
);
REMOVE_ELEM
(
p_sap
->
pp_sessions
,
p_sap
->
i_sessions
,
i
);
FREE
(
p_session
);
FREE
NULL
(
p_session
);
}
/* Free the remaining addresses */
for
(
i
=
0
;
i
<
p_sap
->
i_addresses
;
i
++
)
{
sap_address_t
*
p_address
=
p_sap
->
pp_addresses
[
i
];
FREE
(
p_address
->
psz_address
);
FREE
NULL
(
p_address
->
psz_address
);
if
(
p_address
->
i_rfd
>
-
1
)
{
net_Close
(
p_address
->
i_rfd
);
...
...
@@ -166,7 +164,7 @@ void announce_SAPHandlerDestroy( sap_handler_t *p_sap )
net_Close
(
p_address
->
i_wfd
);
}
REMOVE_ELEM
(
p_sap
->
pp_addresses
,
p_sap
->
i_addresses
,
i
);
FREE
(
p_address
);
FREE
NULL
(
p_address
);
}
/* Free the structure */
...
...
@@ -526,8 +524,8 @@ static int announce_SAPAnnounceDel( sap_handler_t *p_sap,
p_sap
->
i_sessions
,
i
);
FREE
(
p_session
->
p_sap
->
psz_sdp
);
FREE
(
p_session
->
p_sap
->
psz_data
);
FREE
NULL
(
p_session
->
p_sap
->
psz_sdp
);
FREE
NULL
(
p_session
->
p_sap
->
psz_data
);
free
(
p_session
->
p_sap
);
break
;
}
...
...
src/stream_output/stream_output.c
View file @
2d824acd
...
...
@@ -63,8 +63,6 @@ static int mrl_Parse( mrl_t *p_mrl, char *psz_mrl );
/* mrl_Clean: clean p_mrl after a call to mrl_Parse */
static
void
mrl_Clean
(
mrl_t
*
p_mrl
);
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
/*****************************************************************************
* sout_NewInstance: creates a new stream output instance
*****************************************************************************/
...
...
@@ -147,8 +145,8 @@ sout_instance_t *__sout_NewInstance( vlc_object_t *p_parent, char * psz_dest )
{
msg_Err
(
p_sout
,
"stream chain failed for `%s'"
,
p_sout
->
psz_chain
);
FREE
(
p_sout
->
psz_sout
);
FREE
(
p_sout
->
psz_chain
);
FREE
NULL
(
p_sout
->
psz_sout
);
FREE
NULL
(
p_sout
->
psz_chain
);
vlc_object_detach
(
p_sout
);
vlc_object_destroy
(
p_sout
);
...
...
@@ -170,8 +168,8 @@ void sout_DeleteInstance( sout_instance_t * p_sout )
sout_StreamDelete
(
p_sout
->
p_stream
);
/* *** free all string *** */
FREE
(
p_sout
->
psz_sout
);
FREE
(
p_sout
->
psz_chain
);
FREE
NULL
(
p_sout
->
psz_sout
);
FREE
NULL
(
p_sout
->
psz_chain
);
/* delete meta */
if
(
p_sout
->
p_meta
)
...
...
@@ -426,7 +424,7 @@ sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, char *psz_mux,
if
(
p_mux
->
p_module
==
NULL
)
{
FREE
(
p_mux
->
psz_mux
);
FREE
NULL
(
p_mux
->
psz_mux
);
vlc_object_detach
(
p_mux
);
vlc_object_destroy
(
p_mux
);
...
...
@@ -723,9 +721,9 @@ static int mrl_Parse( mrl_t *p_mrl, char *psz_mrl )
/* mrl_Clean: clean p_mrl after a call to mrl_Parse */
static
void
mrl_Clean
(
mrl_t
*
p_mrl
)
{
FREE
(
p_mrl
->
psz_access
);
FREE
(
p_mrl
->
psz_way
);
FREE
(
p_mrl
->
psz_name
);
FREE
NULL
(
p_mrl
->
psz_access
);
FREE
NULL
(
p_mrl
->
psz_way
);
FREE
NULL
(
p_mrl
->
psz_name
);
}
...
...
@@ -923,8 +921,8 @@ static void sout_CfgDestroy( sout_cfg_t *p_cfg )
p_next
=
p_cfg
->
p_next
;
FREE
(
p_cfg
->
psz_name
);
FREE
(
p_cfg
->
psz_value
);
FREE
NULL
(
p_cfg
->
psz_name
);
FREE
NULL
(
p_cfg
->
psz_value
);
free
(
p_cfg
);
p_cfg
=
p_next
;
...
...
@@ -1143,8 +1141,8 @@ void sout_StreamDelete( sout_stream_t *p_stream )
vlc_object_detach
(
p_stream
);
if
(
p_stream
->
p_module
)
module_Unneed
(
p_stream
,
p_stream
->
p_module
);
FREE
(
p_stream
->
psz_name
);
FREE
(
p_stream
->
psz_next
);
FREE
NULL
(
p_stream
->
psz_name
);
FREE
NULL
(
p_stream
->
psz_next
);
sout_CfgDestroy
(
p_stream
->
p_cfg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment