apply tizen coding rules 99/83599/1
authorNAMJEONGYOON <just.nam@samsung.com>
Fri, 12 Aug 2016 02:34:57 +0000 (11:34 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Fri, 12 Aug 2016 02:34:57 +0000 (11:34 +0900)
Change-Id: I144a10a1a0016cbae800dac38a2919b78b4b2bc4

src/include/mm_player_priv.h
src/mm_player_priv.c

index aba3826..f5ddcfb 100644 (file)
 /*---------------------------------------------------------------------------
 |    GLOBAL CONSTANT DEFINITIONS:                                                                                      |
 ---------------------------------------------------------------------------*/
-enum latency_mode
-{
-    AUDIO_LATENCY_MODE_LOW = 0,     /**< Low audio latency mode */
-    AUDIO_LATENCY_MODE_MID,         /**< Middle audio latency mode */
-    AUDIO_LATENCY_MODE_HIGH,        /**< High audio latency mode */
+enum latency_mode {
+       AUDIO_LATENCY_MODE_LOW = 0,     /**< Low audio latency mode */
+       AUDIO_LATENCY_MODE_MID,         /**< Middle audio latency mode */
+       AUDIO_LATENCY_MODE_HIGH,        /**< High audio latency mode */
 };
 
-enum tag_info
-{
+enum tag_info {
        TAG_AUDIO_CODEC = 0x0001,
        TAG_VIDEO_CODEC = 0x0002,
        TAG_ARTIST              = 0x0004,
@@ -102,8 +100,7 @@ enum tag_info
        TAG_TRACK_NUMBER = 0x0200
 };
 
-enum content_attr_flag
-{
+enum content_attr_flag {
        ATTR_MISSING_ONLY = 0x0001,
        ATTR_DURATION = 0x0002,
        ATTR_AUDIO  = 0x0004,
@@ -113,8 +110,7 @@ enum content_attr_flag
 };
 
 /* async mode makes trouble. alsasink sometimes fails to pause. */
-enum alassink_sync
-{
+enum alassink_sync {
        ALSASINK_SYNC,
        ALSASINK_ASYNC
 };
@@ -123,37 +119,35 @@ enum alassink_sync
  * Enumerations of Player Uri type
  */
 enum MMPlayerUriType {
-       MM_PLAYER_URI_TYPE_NONE,                /**< Player URI type None */
-       MM_PLAYER_URI_TYPE_URL_RTSP,    /**< Player URI type RTSP */
-       MM_PLAYER_URI_TYPE_URL_WFD,  /**< Player URI type WFD */
-       MM_PLAYER_URI_TYPE_URL_HTTP,/**< Player URI type HTTP */
-       MM_PLAYER_URI_TYPE_URL_MMS,/**< Player URI type MMS */
-       MM_PLAYER_URI_TYPE_MEM,         /**< Player URI type Mem */
-       MM_PLAYER_URI_TYPE_FILE,                /**< Player URI type File */
-       MM_PLAYER_URI_TYPE_URL,                 /**< Player URI type URL */
-       MM_PLAYER_URI_TYPE_BUFF,                /**< Player URI type Buffer */
-       MM_PLAYER_URI_TYPE_MS_BUFF,             /**< Player URI type Media Stream Buffer */
-       MM_PLAYER_URI_TYPE_HLS,                 /**< Player URI type http live streaming */
-       MM_PLAYER_URI_TYPE_SS,                  /**< Player URI type Smooth streaming */
+       MM_PLAYER_URI_TYPE_NONE,                        /**< Player URI type None */
+       MM_PLAYER_URI_TYPE_URL_RTSP,            /**< Player URI type RTSP */
+       MM_PLAYER_URI_TYPE_URL_WFD,                     /**< Player URI type WFD */
+       MM_PLAYER_URI_TYPE_URL_HTTP,            /**< Player URI type HTTP */
+       MM_PLAYER_URI_TYPE_URL_MMS,                     /**< Player URI type MMS */
+       MM_PLAYER_URI_TYPE_MEM,                         /**< Player URI type Mem */
+       MM_PLAYER_URI_TYPE_FILE,                        /**< Player URI type File */
+       MM_PLAYER_URI_TYPE_URL,                         /**< Player URI type URL */
+       MM_PLAYER_URI_TYPE_BUFF,                        /**< Player URI type Buffer */
+       MM_PLAYER_URI_TYPE_MS_BUFF,                     /**< Player URI type Media Stream Buffer */
+       MM_PLAYER_URI_TYPE_HLS,                         /**< Player URI type http live streaming */
+       MM_PLAYER_URI_TYPE_SS,                          /**< Player URI type Smooth streaming */
        MM_PLAYER_URI_TYPE_DASH,                        /**< Player URI type Mpeg Dash */
-       MM_PLAYER_URI_TYPE_NO_PERMISSION,/**< Player URI type No Permission  */
+       MM_PLAYER_URI_TYPE_NO_PERMISSION,       /**< Player URI type No Permission  */
        MM_PLAYER_URI_TYPE_TEMP,                        /**< Player URI type Temp */
 };
 
-typedef enum _MissingCodec
-{
-       MISSING_PLUGIN_NONE                     = 0x00,
-       MISSING_PLUGIN_AUDIO                    = 0x01,
-       MISSING_PLUGIN_VIDEO                    = 0x02
-}MissingCodec;
+typedef enum _MissingCodec {
+       MISSING_PLUGIN_NONE = 0x00,
+       MISSING_PLUGIN_AUDIO = 0x01,
+       MISSING_PLUGIN_VIDEO = 0x02
+} MissingCodec;
 
 
-typedef enum _FoundCodec
-{
-       FOUND_PLUGIN_NONE                       = 0x00,
-       FOUND_PLUGIN_AUDIO                      = 0x01,
-       FOUND_PLUGIN_VIDEO                      = 0x02
-}FoundCodec;
+typedef enum _FoundCodec {
+       FOUND_PLUGIN_NONE = 0x00,
+       FOUND_PLUGIN_AUDIO = 0x01,
+       FOUND_PLUGIN_VIDEO = 0x02
+} FoundCodec;
 
 /**
  * Enumeration of signal type
@@ -166,11 +160,10 @@ typedef enum {
        MM_PLAYER_SIGNAL_TYPE_OTHERS,
        MM_PLAYER_SIGNAL_TYPE_ALL,
        MM_PLAYER_SIGNAL_TYPE_MAX = MM_PLAYER_SIGNAL_TYPE_ALL,
-}MMPlayerSignalType;
+} MMPlayerSignalType;
 
 /* main pipeline's element id */
-enum MainElementID
-{
+enum MainElementID {
        MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
        MMPLAYER_M_SRC,
        MMPLAYER_M_2ND_SRC,     /* 2nd Source Element for es buff src */
@@ -225,8 +218,7 @@ enum MainElementID
 };
 
 /* audio pipeline's element id */
-enum AudioElementID
-{
+enum AudioElementID {
        MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
        MMPLAYER_A_TP,
        MMPLAYER_A_CONV,
@@ -242,8 +234,7 @@ enum AudioElementID
 };
 
 /* video pipeline's element id */
-enum VideoElementID
-{
+enum VideoElementID {
        MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
        MMPLAYER_V_FLIP,
        MMPLAYER_V_CONV,
@@ -254,8 +245,7 @@ enum VideoElementID
 };
 
 /* text pipeline's element id */
-enum TextElementID
-{
+enum TextElementID {
        MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
        MMPLAYER_T_QUEUE,
        MMPLAYER_T_VIDEO_QUEUE,
@@ -267,15 +257,13 @@ enum TextElementID
 };
 
 /* midi main pipeline's element id */
-enum MidiElementID
-{
+enum MidiElementID {
        MMPLAYER_MIDI_PIPE,
        MMPLAYER_MIDI_PLAYER,
        MMPLAYER_MIDI_NUM
 };
 
-enum PlayerCommandState
-{
+enum PlayerCommandState {
        MMPLAYER_COMMAND_NONE,
        MMPLAYER_COMMAND_CREATE,
        MMPLAYER_COMMAND_DESTROY,
@@ -292,8 +280,7 @@ enum PlayerCommandState
  *     using custom message made by itself. The enum value must start with zero,
  *     because the streaming source(secrtspsrc) also does.
  */
-enum StreamingSrcError
-{
+enum StreamingSrcError {
        MMPLAYER_STREAMING_ERROR_NONE = 0,
        MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
        MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
@@ -346,23 +333,20 @@ enum StreamingSrcError
 |    GLOBAL DATA TYPE DEFINITIONS:                                                                                     |
 ---------------------------------------------------------------------------*/
 
-typedef struct
-{
+typedef struct {
        int id;
        GstElement *gst;
 } MMPlayerGstElement;
 
-typedef struct
-{
-       GstTagList                      *tag_list;
-       MMPlayerGstElement      *mainbin;
-       MMPlayerGstElement      *audiobin;
-       MMPlayerGstElement      *videobin;
-       MMPlayerGstElement      *textbin;
+typedef struct {
+       GstTagList *tag_list;
+       MMPlayerGstElement *mainbin;
+       MMPlayerGstElement *audiobin;
+       MMPlayerGstElement *videobin;
+       MMPlayerGstElement *textbin;
 } MMPlayerGstPipelineInfo;
 
-typedef struct
-{
+typedef struct {
        float volume;
        int mute;
        int bluetooth;  /* enable/disable */
@@ -388,7 +372,7 @@ typedef struct {
        bool is_pending;
        MMPlayerPosFormatType format;
        unsigned long pos;
-}MMPlayerPendingSeek;
+} MMPlayerPendingSeek;
 
 typedef struct {
        GObject* obj;
@@ -402,17 +386,17 @@ typedef struct {
        bool video_zc; // video zero-copy
        bool subtitle_off;
        bool media_packet_video_stream;
-}MMPlayerSetMode;
+} MMPlayerSetMode;
 
 typedef struct {
        GMainContext *global_default;
        GMainContext *thread_default;
-}MMPlayerGMainContext;
+} MMPlayerGMainContext;
 
 typedef struct {
        gint uri_idx;
        GList *uri_list;
-}MMPlayerUriList;
+} MMPlayerUriList;
 
 typedef struct {
        gint active_pad_index;
@@ -760,21 +744,19 @@ typedef struct {
        int pcm_channel;
 } mm_player_t;
 
-typedef struct
-{
+typedef struct {
        gchar *language_code;
        gchar *language_key;
        gboolean active;
-}MMPlayerLangStruct;
+} MMPlayerLangStruct;
 
-typedef struct
-{
+typedef struct {
        GstPad *dump_pad;
        gulong probe_handle_id;
        FILE *dump_element_file;
 } mm_player_dump_t;
 
-typedef struct{
+typedef struct {
        char *name;
        int value_type;
        int flags;                              // r, w
@@ -782,12 +764,12 @@ typedef struct{
        int valid_type;                 // validity type
        int value_min;                  //<- set validity value range
        int value_max;          //->
-}MMPlayerAttrsSpec;
+} MMPlayerAttrsSpec;
 
 /*===========================================================================================
 |                                                                                                                                                                                      |
 |  GLOBAL FUNCTION PROTOTYPES                                                                                                                          |
-|                                                                                                                                                                                      |
+|                                                                                                                                                                                      |
 ========================================================================================== */
 #ifdef __cplusplus
        extern "C" {
@@ -809,7 +791,7 @@ int _mmplayer_resume(MMHandleType hplayer);
 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format,  int pos);
-int _mmplayer_adjust_video_postion(MMHandleType hplayer,int offset);
+int _mmplayer_adjust_video_postion(MMHandleType hplayer, int offset);
 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
 int _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size);
@@ -817,10 +799,10 @@ int _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming);
 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
 int _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
 int _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_changed_callback callback, void *user_param);
-int _mmplayer_set_videostream_cb(MMHandleType hplayer,mm_player_video_stream_callback callback, void *user_param);
-int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_callback callback, void *user_param);
-int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent);
-int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent);
+int _mmplayer_set_videostream_cb(MMHandleType hplayer, mm_player_video_stream_callback callback, void *user_param);
+int _mmplayer_set_audiostream_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
+int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent);
+int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int* silent);
 int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filepath);
 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
 
@@ -837,14 +819,14 @@ int _mmplayer_set_audiostream_cb_ex(MMHandleType hplayer, bool sync, mm_player_a
 gboolean __mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param);
 
 int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel ch_idx);
-int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType type, int index);
+int _mmplayer_change_track_language(MMHandleType hplayer, MMPlayerTrackType type, int index);
 int _mmplayer_sync_subtitle_pipeline(mm_player_t* player);
 int _mmplayer_set_prepare_buffering_time(MMHandleType hplayer, int second);
 int _mmplayer_set_runtime_buffering_mode(MMHandleType hplayer, MMPlayerBufferingMode mode, int second);
 int _mmplayer_set_display_zoom(MMHandleType hplayer, float level, int x, int y);
 int _mmplayer_get_display_zoom(MMHandleType hplayer, float *level, int *x, int *y);
 int _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode);
-int _mmplayer_use_system_clock (MMHandleType hplayer);
+int _mmplayer_use_system_clock(MMHandleType hplayer);
 int _mmplayer_set_video_share_master_clock(MMHandleType hplayer, long long clock, long long clock_delta, long long video_time, long long media_clock, long long audio_time);
 int _mmplayer_get_video_share_master_clock(MMHandleType hplayer, long long *video_time, long long *media_clock, long long *audio_time);
 int _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle);
@@ -859,30 +841,30 @@ void _mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
 int _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel);
 int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
 int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
-int __mmplayer_gst_set_state (mm_player_t* player, GstElement * pipeline,  GstState state, gboolean async, gint timeout );
+int __mmplayer_gst_set_state(mm_player_t* player, GstElement * pipeline,  GstState state, gboolean async, gint timeout);
 int __mmplayer_set_state(mm_player_t* player, int state);
 int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command);
-gboolean __mmplayer_dump_pipeline_state( mm_player_t* player );
+gboolean __mmplayer_dump_pipeline_state(mm_player_t* player);
 void __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id);
 /* util */
-const gchar * __get_state_name ( int state );
+const gchar * __get_state_name(int state);
 gboolean __mmplayer_can_do_interrupt(mm_player_t *player);
-gboolean __is_streaming( mm_player_t* player );
-gboolean __is_rtsp_streaming( mm_player_t* player );
-gboolean __is_wfd_streaming( mm_player_t* player );
-gboolean __is_live_streaming ( mm_player_t* player );
-gboolean __is_http_streaming( mm_player_t* player );
-gboolean __is_http_live_streaming( mm_player_t* player );
-gboolean __is_dash_streaming( mm_player_t* player );
-gboolean __is_smooth_streaming( mm_player_t* player );
+gboolean __is_streaming(mm_player_t* player);
+gboolean __is_rtsp_streaming(mm_player_t* player);
+gboolean __is_wfd_streaming(mm_player_t* player);
+gboolean __is_live_streaming(mm_player_t* player);
+gboolean __is_http_streaming(mm_player_t* player);
+gboolean __is_http_live_streaming(mm_player_t* player);
+gboolean __is_dash_streaming(mm_player_t* player);
+gboolean __is_smooth_streaming(mm_player_t* player);
 gboolean __is_http_progressive_down(mm_player_t* player);
 
 gboolean __mmplayer_check_useful_message(mm_player_t *player, GstMessage * message);
-gboolean __mmplayer_handle_gst_error ( mm_player_t* player, GstMessage * message, GError* error );
-gint __gst_handle_core_error( mm_player_t* player, int code );
-gint __gst_handle_library_error( mm_player_t* player, int code );
-gint __gst_handle_resource_error( mm_player_t* player, int code );
-gint __gst_handle_stream_error( mm_player_t* player, GError* error, GstMessage * message );
+gboolean __mmplayer_handle_gst_error(mm_player_t* player, GstMessage * message, GError* error);
+gint __gst_handle_core_error(mm_player_t* player, int code);
+gint __gst_handle_library_error(mm_player_t* player, int code);
+gint __gst_handle_resource_error(mm_player_t* player, int code);
+gint __gst_handle_stream_error(mm_player_t* player, GError* error, GstMessage * message);
 int _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid);
 int _mmplayer_get_client_pid(MMHandleType hplayer, int* pid);
 int __mmplayer_get_video_angle(mm_player_t* player, int *user_angle, int *org_angle);
index e3fda24..15a4927 100644 (file)
@@ -98,9 +98,9 @@
 
 #define MMPLAYER_USE_FILE_FOR_BUFFERING(player) \
        (((player)->profile.uri_type != MM_PLAYER_URI_TYPE_HLS) && \
-        (player->ini.http_use_file_buffer) && \
-        (player->http_file_buffering_path) && \
-        (strlen(player->http_file_buffering_path) > 0) )
+       (player->ini.http_use_file_buffer) && \
+       (player->http_file_buffering_path) && \
+       (strlen(player->http_file_buffering_path) > 0))
 #define MM_PLAYER_NAME "mmplayer"
 
 /*---------------------------------------------------------------------------
@@ -144,11 +144,11 @@ static void       __mmplayer_gst_element_added(GstElement* bin, GstElement* element, g
 static GstElement * __mmplayer_create_decodebin(mm_player_t* player);
 static gboolean __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstCaps *caps);
 
-static void    __mmplayer_typefind_have_type(  GstElement *tf, guint probability, GstCaps *caps, gpointer data);
+static void    __mmplayer_typefind_have_type( GstElement *tf, guint probability, GstCaps *caps, gpointer data);
 static gboolean __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps);
 static void    __mmplayer_pipeline_complete(GstElement *decodebin,  gpointer data);
 static gboolean __mmplayer_is_midi_type(gchar* str_caps);
-static gboolean __mmplayer_is_only_mp3_type (gchar *str_caps);
+static gboolean __mmplayer_is_only_mp3_type(gchar *str_caps);
 static void    __mmplayer_set_audio_attrs(mm_player_t* player, GstCaps* caps);
 //static void  __mmplayer_check_video_zero_cpoy(mm_player_t* player, GstElementFactory* factory);
 
@@ -156,11 +156,11 @@ static gboolean   __mmplayer_close_link(mm_player_t* player, GstPad *srcpad, GstEl
 static gboolean __mmplayer_feature_filter(GstPluginFeature *feature, gpointer data);
 static void            __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer data);
 
-static void            __mmplayer_gst_rtp_no_more_pads (GstElement *element,  gpointer data);
-//static void    __mmplayer_gst_wfd_dynamic_pad (GstElement *element, GstPad *pad, gpointer data);
-static void            __mmplayer_gst_rtp_dynamic_pad (GstElement *element, GstPad *pad, gpointer data);
-static gboolean        __mmplayer_get_stream_service_type( mm_player_t* player );
-static gboolean        __mmplayer_update_subtitle( GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data);
+static void            __mmplayer_gst_rtp_no_more_pads(GstElement *element,  gpointer data);
+//static void    __mmplayer_gst_wfd_dynamic_pad(GstElement *element, GstPad *pad, gpointer data);
+static void            __mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data);
+static gboolean        __mmplayer_get_stream_service_type(mm_player_t* player);
+static gboolean        __mmplayer_update_subtitle(GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data);
 
 
 static void            __mmplayer_init_factories(mm_player_t* player);
@@ -168,32 +168,32 @@ static void               __mmplayer_release_factories(mm_player_t* player);
 static void            __mmplayer_release_misc(mm_player_t* player);
 static void            __mmplayer_release_misc_post(mm_player_t* player);
 static gboolean        __mmplayer_init_gstreamer(mm_player_t* player);
-static GstBusSyncReply __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data);
+static GstBusSyncReply __mmplayer_bus_sync_callback(GstBus * bus, GstMessage * message, gpointer data);
 static gboolean __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data);
 
 static gboolean        __mmplayer_gst_extract_tag_from_msg(mm_player_t* player, GstMessage *msg);
 static gboolean      __mmplayer_gst_handle_duration(mm_player_t* player, GstMessage* msg);
 
-int            __mmplayer_switch_audio_sink (mm_player_t* player);
+int            __mmplayer_switch_audio_sink(mm_player_t* player);
 static gboolean __mmplayer_gst_remove_fakesink(mm_player_t* player, MMPlayerGstElement* fakesink);
-static GstPadProbeReturn __mmplayer_audio_stream_probe (GstPad *pad, GstPadProbeInfo *info, gpointer u_data);
+static GstPadProbeReturn __mmplayer_audio_stream_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data);
 static void __mmplayer_video_stream_decoded_preroll_cb(GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data);
 static void __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data);
-static GstPadProbeReturn __mmplayer_subtitle_adjust_position_probe (GstPad *pad, GstPadProbeInfo *info, gpointer u_data);
-static int __mmplayer_change_selector_pad (mm_player_t* player, MMPlayerTrackType type, int index);
+static GstPadProbeReturn __mmplayer_subtitle_adjust_position_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data);
+static int __mmplayer_change_selector_pad(mm_player_t* player, MMPlayerTrackType type, int index);
 
-static gboolean __mmplayer_check_subtitle( mm_player_t* player );
-static gboolean __mmplayer_handle_streaming_error  ( mm_player_t* player, GstMessage * message );
-static void            __mmplayer_handle_eos_delay( mm_player_t* player, int delay_in_ms );
-static void            __mmplayer_cancel_eos_timer( mm_player_t* player );
+static gboolean __mmplayer_check_subtitle(mm_player_t* player);
+static gboolean __mmplayer_handle_streaming_error (mm_player_t* player, GstMessage * message);
+static void            __mmplayer_handle_eos_delay(mm_player_t* player, int delay_in_ms);
+static void            __mmplayer_cancel_eos_timer(mm_player_t* player);
 static gboolean        __mmplayer_eos_timer_cb(gpointer u_data);
-static gboolean __mmplayer_link_decoder( mm_player_t* player,GstPad *srcpad);
-static gboolean __mmplayer_link_sink( mm_player_t* player,GstPad *srcpad);
+static gboolean __mmplayer_link_decoder(mm_player_t* player,GstPad *srcpad);
+static gboolean __mmplayer_link_sink(mm_player_t* player,GstPad *srcpad);
 static int             __mmplayer_handle_missed_plugin(mm_player_t* player);
 static int             __mmplayer_check_not_supported_codec(mm_player_t* player, const gchar* factory_class, const gchar* mime);
 static gboolean __mmplayer_configure_audio_callback(mm_player_t* player);
-static void            __mmplayer_add_sink( mm_player_t* player, GstElement* sink);
-static void            __mmplayer_del_sink( mm_player_t* player, GstElement* sink);
+static void            __mmplayer_add_sink(mm_player_t* player, GstElement* sink);
+static void            __mmplayer_del_sink(mm_player_t* player, GstElement* sink);
 static void            __mmplayer_release_signal_connection(mm_player_t* player, MMPlayerSignalType type);
 static gpointer __mmplayer_next_play_thread(gpointer data);
 static gpointer __mmplayer_repeat_thread(gpointer data);
@@ -202,7 +202,7 @@ static gboolean _mmplayer_update_content_attrs(mm_player_t* player, enum content
 
 static gboolean __mmplayer_add_dump_buffer_probe(mm_player_t *player, GstElement *element);
 static GstPadProbeReturn __mmplayer_dump_buffer_probe_cb(GstPad *pad,  GstPadProbeInfo *info, gpointer u_data);
-static void __mmplayer_release_dump_list (GList *dump_list);
+static void __mmplayer_release_dump_list(GList *dump_list);
 
 static int             __gst_realize(mm_player_t* player);
 static int             __gst_unrealize(mm_player_t* player);
@@ -212,8 +212,8 @@ static int          __gst_pause(mm_player_t* player, gboolean async);
 static int             __gst_resume(mm_player_t* player, gboolean async);
 static gboolean        __gst_seek(mm_player_t* player, GstElement * element, gdouble rate,
                                        GstFormat format, GstSeekFlags flags, GstSeekType cur_type,
-                                       gint64 cur, GstSeekType stop_type, gint64 stop );
-static int __gst_pending_seek ( mm_player_t* player );
+                                       gint64 cur, GstSeekType stop_type, gint64 stop);
+static int __gst_pending_seek(mm_player_t* player);
 
 static int             __gst_set_position(mm_player_t* player, int format, unsigned long position, gboolean internal_called);
 static int             __gst_get_position(mm_player_t* player, int format, unsigned long *position);
@@ -221,10 +221,10 @@ static int                __gst_get_buffer_position(mm_player_t* player, int format, unsigned
 static int             __gst_adjust_subtitle_position(mm_player_t* player, int format, int position);
 static int             __gst_set_message_callback(mm_player_t* player, MMMessageCallback callback, gpointer user_param);
 
-static gboolean __gst_send_event_to_sink( mm_player_t* player, GstEvent* event );
+static gboolean __gst_send_event_to_sink(mm_player_t* player, GstEvent* event);
 
 static int __mmplayer_set_pcm_extraction(mm_player_t* player);
-static gboolean __mmplayer_can_extract_pcm( mm_player_t* player );
+static gboolean __mmplayer_can_extract_pcm(mm_player_t* player);
 
 /*fadeout */
 static void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time);
@@ -262,10 +262,10 @@ static void               __gst_appsrc_feed_video_data(GstElement *element, guint size, gpoin
 static void     __gst_appsrc_feed_subtitle_data(GstElement *element, guint size, gpointer user_data);
 static void            __gst_appsrc_enough_audio_data(GstElement *element, gpointer user_data);
 static void            __gst_appsrc_enough_video_data(GstElement *element, gpointer user_data);
-static gboolean        __gst_seek_audio_data (GstElement * appsrc, guint64 position, gpointer user_data);
-static gboolean        __gst_seek_video_data (GstElement * appsrc, guint64 position, gpointer user_data);
-static gboolean        __gst_seek_subtitle_data (GstElement * appsrc, guint64 position, gpointer user_data);
-static void    __mmplayer_gst_caps_notify_cb (GstPad * pad, GParamSpec * unused, gpointer data);
+static gboolean        __gst_seek_audio_data(GstElement * appsrc, guint64 position, gpointer user_data);
+static gboolean        __gst_seek_video_data(GstElement * appsrc, guint64 position, gpointer user_data);
+static gboolean        __gst_seek_subtitle_data(GstElement * appsrc, guint64 position, gpointer user_data);
+static void    __mmplayer_gst_caps_notify_cb(GstPad * pad, GParamSpec * unused, gpointer data);
 static void            __mmplayer_audio_stream_clear_buffer(mm_player_t* player, gboolean send_all);
 static void            __mmplayer_audio_stream_send_data(mm_player_t* player, mm_player_audio_stream_buff_t *a_buffer);
 
@@ -277,32 +277,32 @@ static void               __mmplayer_audio_stream_send_data(mm_player_t* player, mm_player_au
 
 #if 0 //debug
 static void
-print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
+print_tag(const GstTagList * list, const gchar * tag, gpointer unused)
 {
   gint i, count;
 
-  count = gst_tag_list_get_tag_size (list, tag);
+  count = gst_tag_list_get_tag_size(list, tag);
 
   LOGD("count = %d", count);
 
   for (i = 0; i < count; i++) {
     gchar *str;
 
-    if (gst_tag_get_type (tag) == G_TYPE_STRING) {
-      if (!gst_tag_list_get_string_index (list, tag, i, &str))
-        g_assert_not_reached ();
+    if (gst_tag_get_type(tag) == G_TYPE_STRING) {
+      if (!gst_tag_list_get_string_index(list, tag, i, &str))
+        g_assert_not_reached();
     } else {
       str =
-          g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i));
+          g_strdup_value_contents(gst_tag_list_get_value_index(list, tag, i));
     }
 
     if (i == 0) {
-      g_print ("  %15s: %s\n", gst_tag_get_nick (tag), str);
+      g_print("  %15s: %s\n", gst_tag_get_nick(tag), str);
     } else {
-      g_print ("                 : %s\n", str);
+      g_print("                 : %s\n", str);
     }
 
-    g_free (str);
+    g_free(str);
   }
 }
 #endif
@@ -327,11 +327,11 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        /* check player state here */
-       if ( MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED &&
-               MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING )
+       if (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED &&
+               MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING)
        {
                /* give warning now only */
                LOGW("be careful. content attributes may not available in this state ");
@@ -339,7 +339,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
 
        /* get content attribute first */
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute");
                return FALSE;
@@ -347,13 +347,13 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
 
        /* get update flag */
 
-       if ( flag & ATTR_MISSING_ONLY )
+       if (flag & ATTR_MISSING_ONLY)
        {
                missing_only = TRUE;
                LOGD("updating missed attr only");
        }
 
-       if ( flag & ATTR_ALL )
+       if (flag & ATTR_ALL)
        {
                all = TRUE;
                has_duration = FALSE;
@@ -364,29 +364,29 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
                LOGD("updating all attrs");
        }
 
-       if ( missing_only && all )
+       if (missing_only && all)
        {
                LOGW("cannot use ATTR_MISSING_ONLY and ATTR_ALL. ignoring ATTR_MISSING_ONLY flag!");
                missing_only = FALSE;
        }
 
-       if (  (flag & ATTR_DURATION) || (!has_duration && missing_only) || all )
+       if ((flag & ATTR_DURATION) ||   (!has_duration && missing_only) || all)
        {
                LOGD("try to update duration");
                has_duration = FALSE;
 
-               if (gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec ))
+               if (gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec))
                {
                        player->duration = dur_nsec;
                        LOGW("duration : %lld msec", GST_TIME_AS_MSECONDS(dur_nsec));
                }
 
                /* try to get streaming service type */
-               stream_service_type = __mmplayer_get_stream_service_type( player );
-               mm_attrs_set_int_by_name ( attrs, "streaming_type", stream_service_type );
+               stream_service_type = __mmplayer_get_stream_service_type(player);
+               mm_attrs_set_int_by_name(attrs, "streaming_type", stream_service_type);
 
                /* check duration is OK */
-               if ( dur_nsec == 0 && !MMPLAYER_IS_LIVE_STREAMING( player ) )
+               if (dur_nsec == 0 && !MMPLAYER_IS_LIVE_STREAMING(player))
                {
                        /* FIXIT : find another way to get duration here. */
                        LOGE("finally it's failed to get duration from pipeline. progressbar will not work correctely!");
@@ -399,7 +399,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
                }
        }
 
-       if (  (flag & ATTR_AUDIO) || (!has_audio_attrs && missing_only) || all )
+       if ((flag & ATTR_AUDIO) || (!has_audio_attrs && missing_only) || all)
        {
                /* update audio params
                NOTE : We need original audio params and it can be only obtained from src pad of audio
@@ -409,35 +409,35 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
                LOGD("try to update audio attrs");
                has_audio_attrs = FALSE;
 
-               if ( player->pipeline->audiobin &&
-                        player->pipeline->audiobin[MMPLAYER_A_SINK].gst )
+               if (player->pipeline->audiobin &&
+                        player->pipeline->audiobin[MMPLAYER_A_SINK].gst)
                {
                        GstCaps *caps_a = NULL;
                        GstPad* pad = NULL;
                        gint samplerate = 0, channels = 0;
 
                        pad = gst_element_get_static_pad(
-                                       player->pipeline->audiobin[MMPLAYER_A_CONV].gst, "sink" );
+                                       player->pipeline->audiobin[MMPLAYER_A_CONV].gst, "sink");
 
-                       if ( pad )
+                       if (pad)
                        {
-                               caps_a = gst_pad_get_current_caps( pad );
+                               caps_a = gst_pad_get_current_caps(pad);
 
-                               if ( caps_a )
+                               if (caps_a)
                                {
-                                       p = gst_caps_get_structure (caps_a, 0);
+                                       p = gst_caps_get_structure(caps_a, 0);
 
                                        mm_attrs_get_int_by_name(attrs, "content_audio_samplerate", &samplerate);
 
-                                       gst_structure_get_int (p, "rate", &samplerate);
+                                       gst_structure_get_int(p, "rate", &samplerate);
                                        mm_attrs_set_int_by_name(attrs, "content_audio_samplerate", samplerate);
 
-                                       gst_structure_get_int (p, "channels", &channels);
+                                       gst_structure_get_int(p, "channels", &channels);
                                        mm_attrs_set_int_by_name(attrs, "content_audio_channels", channels);
 
                                        SECURE_LOGD("samplerate : %d    channels : %d", samplerate, channels);
 
-                                       gst_caps_unref( caps_a );
+                                       gst_caps_unref(caps_a);
                                        caps_a = NULL;
 
                                        has_audio_attrs = TRUE;
@@ -447,7 +447,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
                                        LOGW("not ready to get audio caps");
                                }
 
-                               gst_object_unref( pad );
+                               gst_object_unref(pad);
                        }
                        else
                        {
@@ -456,23 +456,23 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
                }
        }
 
-       if ( (flag & ATTR_VIDEO) || (!has_video_attrs && missing_only) || all )
+       if ((flag & ATTR_VIDEO) || (!has_video_attrs && missing_only) || all)
        {
                LOGD("try to update video attrs");
                has_video_attrs = FALSE;
 
-               if ( player->pipeline->videobin &&
-                        player->pipeline->videobin[MMPLAYER_V_SINK].gst )
+               if (player->pipeline->videobin &&
+                        player->pipeline->videobin[MMPLAYER_V_SINK].gst)
                {
                        GstCaps *caps_v = NULL;
                        GstPad* pad = NULL;
                        gint tmpNu, tmpDe;
                        gint width, height;
 
-                       pad = gst_element_get_static_pad( player->pipeline->videobin[MMPLAYER_V_SINK].gst, "sink" );
-                       if ( pad )
+                       pad = gst_element_get_static_pad(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "sink");
+                       if (pad)
                        {
-                               caps_v = gst_pad_get_current_caps( pad );
+                               caps_v = gst_pad_get_current_caps(pad);
 
                                /* Use v_stream_caps, if fail to get video_sink sink pad*/
                                if (!caps_v && player->v_stream_caps)
@@ -483,18 +483,18 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
 
                                if (caps_v)
                                {
-                                       p = gst_caps_get_structure (caps_v, 0);
-                                       gst_structure_get_int (p, "width", &width);
+                                       p = gst_caps_get_structure(caps_v, 0);
+                                       gst_structure_get_int(p, "width", &width);
                                        mm_attrs_set_int_by_name(attrs, "content_video_width", width);
 
-                                       gst_structure_get_int (p, "height", &height);
+                                       gst_structure_get_int(p, "height", &height);
                                        mm_attrs_set_int_by_name(attrs, "content_video_height", height);
 
-                                       gst_structure_get_fraction (p, "framerate", &tmpNu, &tmpDe);
+                                       gst_structure_get_fraction(p, "framerate", &tmpNu, &tmpDe);
 
-                                       SECURE_LOGD("width : %d     height : %d", width, height );
+                                       SECURE_LOGD("width : %d     height : %d", width, height);
 
-                                       gst_caps_unref( caps_v );
+                                       gst_caps_unref(caps_v);
                                        caps_v = NULL;
 
                                        if (tmpDe > 0)
@@ -509,7 +509,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
                                {
                                        LOGD("no negitiated caps from videosink");
                                }
-                               gst_object_unref( pad );
+                               gst_object_unref(pad);
                                pad = NULL;
                        }
                        else
@@ -520,7 +520,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
        }
 
 
-       if ( (flag & ATTR_BITRATE) || (!has_bitrate && missing_only) || all )
+       if ((flag & ATTR_BITRATE) || (!has_bitrate && missing_only) || all)
        {
                has_bitrate = FALSE;
 
@@ -559,7 +559,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
 
                        if (MMPLAYER_IS_RTSP_STREAMING(player))
                        {
-                               if(player->total_bitrate)
+                               if (player->total_bitrate)
                                {
                                        mm_attrs_set_int_by_name(attrs, "content_video_bitrate", player->total_bitrate);
                                        has_bitrate = TRUE;
@@ -569,7 +569,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
        }
 
        /* validate all */
-       if (  mmf_attrs_commit ( attrs ) )
+       if ( mmf_attrs_commit(attrs))
        {
                LOGE("failed to update attributes\n");
                return FALSE;
@@ -580,20 +580,20 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
        return TRUE;
 }
 
-static gboolean __mmplayer_get_stream_service_type( mm_player_t* player )
+static gboolean __mmplayer_get_stream_service_type(mm_player_t* player)
 {
        gint streaming_type = STREAMING_SERVICE_NONE;
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player &&
+       MMPLAYER_RETURN_VAL_IF_FAIL(player &&
                        player->pipeline &&
                        player->pipeline->mainbin &&
                        player->pipeline->mainbin[MMPLAYER_M_SRC].gst,
-                       FALSE );
+                       FALSE);
 
        /* streaming service type if streaming */
-       if ( ! MMPLAYER_IS_STREAMING(player) )
+       if (!MMPLAYER_IS_STREAMING(player))
                return STREAMING_SERVICE_NONE;
 
        if (MMPLAYER_IS_HTTP_STREAMING(player))
@@ -602,7 +602,7 @@ static gboolean __mmplayer_get_stream_service_type( mm_player_t* player )
                        STREAMING_SERVICE_LIVE : STREAMING_SERVICE_VOD;
        }
 
-       switch ( streaming_type )
+       switch (streaming_type)
        {
                case STREAMING_SERVICE_LIVE:
                        LOGD("it's live streaming");
@@ -637,9 +637,9 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
        gboolean interrupted_by_resource = FALSE;
        int ret = MM_ERROR_NONE;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
-       if ( MMPLAYER_CURRENT_STATE(player) == state )
+       if (MMPLAYER_CURRENT_STATE(player) == state)
        {
                LOGW("already same state(%s)\n", MMPLAYER_STATE_GET_NAME(state));
                MMPLAYER_PENDING_STATE(player) = MM_PLAYER_STATE_NONE;
@@ -651,11 +651,11 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
        MMPLAYER_CURRENT_STATE(player) = state;
 
        /* FIXIT : it's better to do like below code
-       if ( MMPLAYER_CURRENT_STATE(player) == MMPLAYER_TARGET_STATE(player) )
+       if (MMPLAYER_CURRENT_STATE(player) == MMPLAYER_TARGET_STATE(player))
                        MMPLAYER_PENDING_STATE(player) = MM_PLAYER_STATE_NONE;
        and add more code to handling PENDING_STATE.
        */
-       if ( MMPLAYER_CURRENT_STATE(player) == MMPLAYER_PENDING_STATE(player) )
+       if (MMPLAYER_CURRENT_STATE(player) == MMPLAYER_PENDING_STATE(player))
                MMPLAYER_PENDING_STATE(player) = MM_PLAYER_STATE_NONE;
 
        /* print state */
@@ -665,7 +665,7 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
        interrupted_by_focus = player->sound_focus.by_asm_cb;
        interrupted_by_resource = player->resource_manager.by_rm_cb;
 
-       switch ( MMPLAYER_CURRENT_STATE(player) )
+       switch (MMPLAYER_CURRENT_STATE(player))
        {
                case MM_PLAYER_STATE_NULL:
                case MM_PLAYER_STATE_READY:
@@ -673,7 +673,7 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                        if (player->cmd == MMPLAYER_COMMAND_STOP)
                        {
                                sound_result = _mmplayer_sound_release_focus(&player->sound_focus);
-                               if ( sound_result != MM_ERROR_NONE )
+                               if (sound_result != MM_ERROR_NONE)
                                {
                                        LOGE("failed to release sound focus\n");
                                        return MM_ERROR_POLICY_INTERNAL;
@@ -684,13 +684,13 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
 
                case MM_PLAYER_STATE_PAUSED:
                {
-                        if ( ! player->sent_bos )
+                        if (!player->sent_bos)
                         {
                                int found = 0;
                                #define MMPLAYER_MAX_SOUND_PRIORITY     3
 
                                /* it's first time to update all content attrs. */
-                               _mmplayer_update_content_attrs( player, ATTR_ALL );
+                               _mmplayer_update_content_attrs(player, ATTR_ALL);
                                /* set max sound priority to keep own sound and not to mute other's one */
                                mm_attrs_get_int_by_name(player->attrs, "content_video_found", &found);
                                if (found)
@@ -706,7 +706,7 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                         }
 
                        /* add audio callback probe if condition is satisfied */
-                       if ( ! player->audio_cb_probe_id && player->set_mode.pcm_extraction && !player->audio_stream_render_cb_ex)
+                       if (!player->audio_cb_probe_id && player->set_mode.pcm_extraction && !player->audio_stream_render_cb_ex)
                        {
                                __mmplayer_configure_audio_callback(player);
                                /* FIXIT : handle return value */
@@ -715,7 +715,7 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                        if (!MMPLAYER_IS_STREAMING(player) || (player->streamer && !player->streamer->is_buffering))
                        {
                                sound_result = _mmplayer_sound_release_focus(&player->sound_focus);
-                               if ( sound_result != MM_ERROR_NONE )
+                               if (sound_result != MM_ERROR_NONE)
                                {
                                        LOGE("failed to release sound focus\n");
                                        return MM_ERROR_POLICY_INTERNAL;
@@ -727,19 +727,19 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                case MM_PLAYER_STATE_PLAYING:
                {
                        /* try to get content metadata */
-                       if ( ! player->sent_bos )
+                       if (!player->sent_bos)
                        {
                                /* NOTE : giving ATTR_MISSING_ONLY may have dependency with
                                 * c-api since c-api doesn't use _start() anymore. It may not work propery with
                                 * legacy mmfw-player api */
-                               _mmplayer_update_content_attrs( player, ATTR_MISSING_ONLY);
+                               _mmplayer_update_content_attrs(player, ATTR_MISSING_ONLY);
                        }
 
-                       if ( (player->cmd == MMPLAYER_COMMAND_START) || (player->cmd == MMPLAYER_COMMAND_RESUME) )
+                       if ((player->cmd == MMPLAYER_COMMAND_START) || (player->cmd == MMPLAYER_COMMAND_RESUME))
                        {
                                if (!player->sent_bos)
                                {
-                                       __mmplayer_handle_missed_plugin ( player );
+                                       __mmplayer_handle_missed_plugin(player);
                                }
                                sound_result = _mmplayer_sound_acquire_focus(&player->sound_focus);
                                if (sound_result != MM_ERROR_NONE)
@@ -753,7 +753,7 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
 
                                                msg.union_type = MM_MSG_UNION_CODE;
                                                msg.code = MM_ERROR_POLICY_INTERRUPTED;
-                                               MMPLAYER_POST_MSG( player, MM_MESSAGE_STATE_INTERRUPTED, &msg);
+                                               MMPLAYER_POST_MSG(player, MM_MESSAGE_STATE_INTERRUPTED, &msg);
 
                                                _mmplayer_unrealize((MMHandleType)player);
                                        }
@@ -768,14 +768,14 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                                }
                        }
 
-                       if ( player->resumed_by_rewind && player->playback_rate < 0.0 )
+                       if (player->resumed_by_rewind && player->playback_rate < 0.0)
                        {
                                /* initialize because auto resume is done well. */
                                player->resumed_by_rewind = FALSE;
                                player->playback_rate = 1.0;
                        }
 
-                       if ( !player->sent_bos )
+                       if (!player->sent_bos)
                        {
                                /* check audio codec field is set or not
                                 * we can get it from typefinder or codec's caps.
@@ -787,18 +787,18 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                                 * Because, parser don't make related TAG.
                                 * So, if it's not set yet, fill it with found data.
                                 */
-                               if ( ! audio_codec )
+                               if (!audio_codec)
                                {
-                                       if ( g_strrstr(player->type, "audio/midi"))
+                                       if (g_strrstr(player->type, "audio/midi"))
                                        {
                                                audio_codec = g_strdup("MIDI");
 
                                        }
-                                       else if ( g_strrstr(player->type, "audio/x-amr"))
+                                       else if (g_strrstr(player->type, "audio/x-amr"))
                                        {
                                                audio_codec = g_strdup("AMR");
                                        }
-                                       else if ( g_strrstr(player->type, "audio/mpeg") && !g_strrstr(player->type, "mpegversion=(int)1"))
+                                       else if (g_strrstr(player->type, "audio/mpeg") && !g_strrstr(player->type, "mpegversion= (int)1"))
                                        {
                                                audio_codec = g_strdup("AAC");
                                        }
@@ -832,34 +832,34 @@ __mmplayer_set_state(mm_player_t* player, int state) // @
                msg.state.previous = MMPLAYER_PREV_STATE(player);
                msg.state.current = MMPLAYER_CURRENT_STATE(player);
 
-               LOGD ("player reach the target state (%s)", MMPLAYER_STATE_GET_NAME(MMPLAYER_TARGET_STATE(player)));
+               LOGD("player reach the target state (%s)", MMPLAYER_STATE_GET_NAME(MMPLAYER_TARGET_STATE(player)));
 
                /* state changed by focus or resource callback */
-               if ( interrupted_by_focus || interrupted_by_resource )
+               if (interrupted_by_focus || interrupted_by_resource)
                {
                        msg.union_type = MM_MSG_UNION_CODE;
                        if (interrupted_by_focus)
                                msg.code = player->sound_focus.focus_changed_msg;       /* FIXME: player.c convert function have to be modified. */
                        else if (interrupted_by_resource)
                                msg.code = MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT;
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_STATE_INTERRUPTED, &msg );
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_STATE_INTERRUPTED, &msg);
                }
                /* state changed by usecase */
                else
                {
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_STATE_CHANGED, &msg );
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_STATE_CHANGED, &msg);
                }
        }
        else
        {
-               LOGD ("intermediate state, do nothing.\n");
+               LOGD("intermediate state, do nothing.\n");
                MMPLAYER_PRINT_STATE(player);
                return ret;
        }
 
-       if ( post_bos )
+       if (post_bos)
        {
-               MMPLAYER_POST_MSG ( player, MM_MESSAGE_BEGIN_OF_STREAM, NULL );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_BEGIN_OF_STREAM, NULL);
                player->sent_bos = TRUE;
        }
 
@@ -871,19 +871,19 @@ static gpointer __mmplayer_next_play_thread(gpointer data)
        mm_player_t* player = (mm_player_t*) data;
        MMPlayerGstElement *mainbin = NULL;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, NULL );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, NULL);
 
        g_mutex_lock(&player->next_play_thread_mutex);
-       while ( ! player->next_play_thread_exit )
+       while (!player->next_play_thread_exit)
        {
                LOGD("next play thread started. waiting for signal.\n");
-               g_cond_wait(&player->next_play_thread_cond, &player->next_play_thread_mutex );
+               g_cond_wait(&player->next_play_thread_cond, &player->next_play_thread_mutex);
 
                LOGD("reconfigure pipeline for gapless play.\n");
 
-               if ( player->next_play_thread_exit )
+               if (player->next_play_thread_exit)
                {
-                       if(player->gapless.reconfigure)
+                       if (player->gapless.reconfigure)
                        {
                                player->gapless.reconfigure = false;
                                MMPLAYER_PLAYBACK_UNLOCK(player);
@@ -914,15 +914,15 @@ static gpointer __mmplayer_repeat_thread(gpointer data)
        MMHandleType attrs = 0;
        gint count = 0;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, NULL );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, NULL);
 
        g_mutex_lock(&player->repeat_thread_mutex);
-       while ( ! player->repeat_thread_exit )
+       while (!player->repeat_thread_exit)
        {
                LOGD("repeat thread started. waiting for signal.\n");
-               g_cond_wait(&player->repeat_thread_cond, &player->repeat_thread_mutex );
+               g_cond_wait(&player->repeat_thread_cond, &player->repeat_thread_mutex);
 
-               if ( player->repeat_thread_exit )
+               if (player->repeat_thread_exit)
                {
                        LOGD("exiting repeat thread\n");
                        break;
@@ -940,20 +940,20 @@ static gpointer __mmplayer_repeat_thread(gpointer data)
                        break;
                }
 
-               if ( player->section_repeat )
+               if (player->section_repeat)
                {
                        ret_value = _mmplayer_activate_section_repeat((MMHandleType)player, player->section_repeat_start, player->section_repeat_end);
                }
                else
                {
-                       if ( player->playback_rate < 0.0 )
+                       if (player->playback_rate < 0.0)
                        {
                                player->resumed_by_rewind = TRUE;
                                _mmplayer_set_mute((MMHandleType)player, 0);
-                               MMPLAYER_POST_MSG( player, MM_MESSAGE_RESUMED_BY_REW, NULL );
+                               MMPLAYER_POST_MSG(player, MM_MESSAGE_RESUMED_BY_REW, NULL);
                        }
 
-                       ret_value = __gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
+                       ret_value = __gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
                                0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
 
@@ -961,14 +961,14 @@ static gpointer __mmplayer_repeat_thread(gpointer data)
                        player->sent_bos = FALSE;
                }
 
-               if ( ! ret_value )
+               if (!ret_value)
                {
                        LOGE("failed to set position to zero for rewind\n");
                        continue;
                }
 
                /* decrease play count */
-               if ( count > 1 )
+               if (count > 1)
                {
                        /* we successeded to rewind. update play count and then wait for next EOS */
                        count--;
@@ -976,7 +976,7 @@ static gpointer __mmplayer_repeat_thread(gpointer data)
                        mm_attrs_set_int_by_name(attrs, "profile_play_count", count);
 
                        /* commit attribute */
-                       if ( mmf_attrs_commit ( attrs ) )
+                       if (mmf_attrs_commit(attrs))
                        {
                                LOGE("failed to commit attribute\n");
                        }
@@ -999,12 +999,12 @@ __mmplayer_update_buffer_setting(mm_player_t *player, GstMessage *buffering_msg)
        unsigned long pos_msec = 0;
        struct stat sb;
 
-       MMPLAYER_RETURN_IF_FAIL( player && player->pipeline && player->pipeline->mainbin);
+       MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
 
        __gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, &pos_msec);       // update last_position
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("fail to get attributes.\n");
                return;
@@ -1036,7 +1036,7 @@ __mmplayer_update_buffer_setting(mm_player_t *player, GstMessage *buffering_msg)
 }
 
 static int
-__mmplayer_handle_buffering_message ( mm_player_t* player )
+__mmplayer_handle_buffering_message(mm_player_t* player)
 {
        int ret = MM_ERROR_NONE;
        MMPlayerStateType prev_state = MM_PLAYER_STATE_NONE;
@@ -1044,7 +1044,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
        MMPlayerStateType target_state = MM_PLAYER_STATE_NONE;
        MMPlayerStateType pending_state = MM_PLAYER_STATE_NONE;
 
-       if!player || !player->streamer || (MMPLAYER_IS_LIVE_STREAMING(player) && MMPLAYER_IS_RTSP_STREAMING(player)))
+       if (!player || !player->streamer || (MMPLAYER_IS_LIVE_STREAMING(player) && MMPLAYER_IS_RTSP_STREAMING(player)))
        {
                LOGW("do nothing for buffering msg\n");
                ret = MM_ERROR_PLAYER_INVALID_STATE;
@@ -1056,25 +1056,25 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
        target_state = MMPLAYER_TARGET_STATE(player);
        pending_state = MMPLAYER_PENDING_STATE(player);
 
-       LOGD( "player state : prev %s, current %s, pending %s, target %s, buffering %d",
+       LOGD("player state : prev %s, current %s, pending %s, target %s, buffering %d",
                MMPLAYER_STATE_GET_NAME(prev_state),
                MMPLAYER_STATE_GET_NAME(current_state),
                MMPLAYER_STATE_GET_NAME(pending_state),
                MMPLAYER_STATE_GET_NAME(target_state),
                player->streamer->is_buffering);
 
-       if ( !player->streamer->is_buffering )
+       if (!player->streamer->is_buffering)
        {
                /* NOTE : if buffering has done, player has to go to target state. */
-               switch ( target_state )
+               switch (target_state)
                {
                        case MM_PLAYER_STATE_PAUSED :
                        {
-                               switch ( pending_state )
+                               switch (pending_state)
                                {
                                        case MM_PLAYER_STATE_PLAYING:
                                        {
-                                               __gst_pause ( player, TRUE );
+                                               __gst_pause(player, TRUE);
                                        }
                                        break;
 
@@ -1089,7 +1089,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
                                        case MM_PLAYER_STATE_READY:
                                        default :
                                        {
-                                               LOGW("invalid pending state [%s].\n", MMPLAYER_STATE_GET_NAME(pending_state) );
+                                               LOGW("invalid pending state [%s].\n", MMPLAYER_STATE_GET_NAME(pending_state));
                                        }
                                                break;
                                }
@@ -1098,12 +1098,12 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
 
                        case MM_PLAYER_STATE_PLAYING :
                        {
-                               switch ( pending_state )
+                               switch (pending_state)
                                {
                                        case MM_PLAYER_STATE_NONE:
                                        {
                                                if (current_state != MM_PLAYER_STATE_PLAYING)
-                                                       __gst_resume ( player, TRUE );
+                                                       __gst_resume(player, TRUE);
                                        }
                                        break;
 
@@ -1112,7 +1112,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
                                                /* NOTE: It should be worked as asynchronously.
                                                 * Because, buffering can be completed during autoplugging when pipeline would try to go playing state directly.
                                                 */
-                                               __gst_resume ( player, TRUE );
+                                               __gst_resume(player, TRUE);
                                        }
                                        break;
 
@@ -1126,7 +1126,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
                                        case MM_PLAYER_STATE_READY:
                                        default :
                                        {
-                                               LOGW("invalid pending state [%s].\n", MMPLAYER_STATE_GET_NAME(pending_state) );
+                                               LOGW("invalid pending state [%s].\n", MMPLAYER_STATE_GET_NAME(pending_state));
                                        }
                                                break;
                                }
@@ -1138,7 +1138,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
                        case MM_PLAYER_STATE_NONE :
                        default:
                        {
-                               LOGW("invalid target state [%s].\n", MMPLAYER_STATE_GET_NAME(target_state) );
+                               LOGW("invalid target state [%s].\n", MMPLAYER_STATE_GET_NAME(target_state));
                        }
                                break;
                }
@@ -1148,14 +1148,14 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
                /* NOTE : during the buffering, pause the player for stopping pipeline clock.
                 *      it's for stopping the pipeline clock to prevent dropping the data in sink element.
                 */
-               switch ( pending_state )
+               switch (pending_state)
                {
                        case MM_PLAYER_STATE_NONE:
                        {
                                if (current_state != MM_PLAYER_STATE_PAUSED)
                                {
                                        LOGD("set pause state during buffering\n");
-                                       __gst_pause ( player, TRUE );
+                                       __gst_pause(player, TRUE);
 
                                        // to cover the weak-signal environment.
                                        if (MMPLAYER_IS_RTSP_STREAMING(player))
@@ -1165,7 +1165,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
 
                                                LOGD("[RTSP] seek to the buffering start point\n");
 
-                                               if (__gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, &position ))
+                                               if (__gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, &position))
                                                {
                                                        LOGE("failed to get position\n");
                                                        break;
@@ -1184,7 +1184,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
 
                        case MM_PLAYER_STATE_PLAYING:
                        {
-                               __gst_pause ( player, TRUE );
+                               __gst_pause(player, TRUE);
                        }
                        break;
 
@@ -1197,7 +1197,7 @@ __mmplayer_handle_buffering_message ( mm_player_t* player )
                        case MM_PLAYER_STATE_READY:
                        default :
                        {
-                               LOGW("invalid pending state [%s].\n", MMPLAYER_STATE_GET_NAME(pending_state) );
+                               LOGW("invalid pending state [%s].\n", MMPLAYER_STATE_GET_NAME(pending_state));
                        }
                                break;
                }
@@ -1213,11 +1213,11 @@ __mmplayer_drop_subtitle(mm_player_t* player, gboolean is_drop)
        MMPlayerGstElement *textbin;
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( player &&
+       MMPLAYER_RETURN_IF_FAIL(player &&
                                        player->pipeline &&
                                        player->pipeline->textbin);
 
-       MMPLAYER_RETURN_IF_FAIL (player->pipeline->textbin[MMPLAYER_T_IDENTITY].gst);
+       MMPLAYER_RETURN_IF_FAIL(player->pipeline->textbin[MMPLAYER_T_IDENTITY].gst);
 
        textbin = player->pipeline->textbin;
 
@@ -1239,7 +1239,7 @@ __mmplayer_drop_subtitle(mm_player_t* player, gboolean is_drop)
                        g_object_set(textbin[MMPLAYER_T_IDENTITY].gst, "drop-probability", (gfloat)0.0, NULL);
                        g_object_set(textbin[MMPLAYER_T_FAKE_SINK].gst, "async", TRUE, NULL);
 
-                       LOGD ("non-connected with external display");
+                       LOGD("non-connected with external display");
 
                        player->is_subtitle_force_drop = FALSE;
                }
@@ -1253,10 +1253,10 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
        gboolean ret = TRUE;
        static gboolean async_done = FALSE;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( msg && GST_IS_MESSAGE(msg), FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(msg && GST_IS_MESSAGE(msg), FALSE);
 
-       switch ( GST_MESSAGE_TYPE( msg ) )
+       switch (GST_MESSAGE_TYPE(msg))
        {
                case GST_MESSAGE_UNKNOWN:
                        LOGD("unknown message received\n");
@@ -1271,7 +1271,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
 
                        /* NOTE : EOS event is comming multiple time. watch out it */
                        /* check state. we only process EOS when pipeline state goes to PLAYING */
-                       if ( ! (player->cmd == MMPLAYER_COMMAND_START || player->cmd == MMPLAYER_COMMAND_RESUME) )
+                       if (!(player->cmd == MMPLAYER_COMMAND_START || player->cmd == MMPLAYER_COMMAND_RESUME))
                        {
                                LOGD("EOS received on non-playing state. ignoring it\n");
                                break;
@@ -1282,16 +1282,16 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                if (player->pipeline->textbin)
                                        __mmplayer_drop_subtitle(player, TRUE);
 
-                               if ( (player->audio_stream_cb) && (player->set_mode.pcm_extraction) && (!player->audio_stream_render_cb_ex))
+                               if ((player->audio_stream_cb) && (player->set_mode.pcm_extraction) && (!player->audio_stream_render_cb_ex))
                                {
                                        GstPad *pad = NULL;
 
-                                       pad = gst_element_get_static_pad (player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "sink");
+                                       pad = gst_element_get_static_pad(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "sink");
 
                                        LOGD("release audio callback\n");
 
                                        /* release audio callback */
-                                       gst_pad_remove_probe (pad, player->audio_cb_probe_id);
+                                       gst_pad_remove_probe(pad, player->audio_cb_probe_id);
                                        player->audio_cb_probe_id = 0;
                                        /* audio callback should be free because it can be called even though probe remove.*/
                                        player->audio_stream_cb = NULL;
@@ -1307,7 +1307,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        /* get play count */
                        attrs = MMPLAYER_GET_ATTRS(player);
 
-                       if ( attrs )
+                       if (attrs)
                        {
                                gboolean smooth_repeat = FALSE;
 
@@ -1318,13 +1318,13 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
 
                                LOGD("remaining play count: %d, playback rate: %f\n", count, player->playback_rate);
 
-                               if ( count > 1 || count == -1 || player->playback_rate < 0.0 ) /* default value is 1 */
+                               if (count > 1 || count == -1 || player->playback_rate < 0.0) /* default value is 1 */
                                {
-                                       if ( smooth_repeat )
+                                       if (smooth_repeat)
                                        {
                                                LOGD("smooth repeat enabled. seeking operation will be excuted in new thread\n");
 
-                                               g_cond_signal( &player->repeat_thread_cond );
+                                               g_cond_signal(&player->repeat_thread_cond);
 
                                                break;
                                        }
@@ -1332,26 +1332,26 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                        {
                                                gint ret_value = 0;
 
-                                               if ( player->section_repeat )
+                                               if (player->section_repeat)
                                                {
                                                        ret_value = _mmplayer_activate_section_repeat((MMHandleType)player, player->section_repeat_start, player->section_repeat_end);
                                                }
                                                else
                                                {
-                                                       if ( player->playback_rate < 0.0 )
+                                                       if (player->playback_rate < 0.0)
                                                        {
                                                                player->resumed_by_rewind = TRUE;
                                                                _mmplayer_set_mute((MMHandleType)player, 0);
-                                                               MMPLAYER_POST_MSG( player, MM_MESSAGE_RESUMED_BY_REW, NULL );
+                                                               MMPLAYER_POST_MSG(player, MM_MESSAGE_RESUMED_BY_REW, NULL);
                                                        }
 
-                                                       __mmplayer_handle_eos_delay( player, player->ini.delay_before_repeat );
+                                                       __mmplayer_handle_eos_delay(player, player->ini.delay_before_repeat);
 
                                                        /* initialize */
                                                        player->sent_bos = FALSE;
                                                }
 
-                                               if ( MM_ERROR_NONE != ret_value )
+                                               if (MM_ERROR_NONE != ret_value)
                                                {
                                                        LOGE("failed to set position to zero for rewind\n");
                                                }
@@ -1363,10 +1363,10 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        }
 
                        if (player->pipeline)
-                               MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-eos" );
+                               MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-eos");
 
                        /* post eos message to application */
-                       __mmplayer_handle_eos_delay( player, player->ini.eos_delay );
+                       __mmplayer_handle_eos_delay(player, player->ini.eos_delay);
 
                        /* reset last position */
                        player->last_position = 0;
@@ -1379,42 +1379,42 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        gchar* debug = NULL;
 
                        /* generating debug info before returning error */
-                       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-error" );
+                       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-error");
 
                        /* get error code */
-                       gst_message_parse_error( msg, &error, &debug );
+                       gst_message_parse_error(msg, &error, &debug);
 
-                       if ( gst_structure_has_name ( gst_message_get_structure(msg), "streaming_error" ) )
+                       if (gst_structure_has_name(gst_message_get_structure(msg), "streaming_error"))
                        {
                                /* Note : the streaming error from the streaming source is handled
                                 *   using __mmplayer_handle_streaming_error.
                                 */
-                               __mmplayer_handle_streaming_error ( player, msg );
+                               __mmplayer_handle_streaming_error(player, msg);
 
                                /* dump state of all element */
-                               __mmplayer_dump_pipeline_state( player );
+                               __mmplayer_dump_pipeline_state(player);
                        }
                        else
                        {
                                /* traslate gst error code to msl error code. then post it
                                 * to application if needed
                                 */
-                               __mmplayer_handle_gst_error( player, msg, error );
+                               __mmplayer_handle_gst_error(player, msg, error);
 
                                if (debug)
                                {
-                                       LOGE ("error debug : %s", debug);
+                                       LOGE("error debug : %s", debug);
                                }
 
                        }
 
                        if (MMPLAYER_IS_HTTP_PD(player))
                        {
-                               _mmplayer_unrealize_pd_downloader ((MMHandleType)player);
+                               _mmplayer_unrealize_pd_downloader((MMHandleType)player);
                        }
 
-                       MMPLAYER_FREEIF( debug );
-                       g_error_free( error );
+                       MMPLAYER_FREEIF(debug);
+                       g_error_free(error);
                }
                break;
 
@@ -1428,17 +1428,17 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        LOGD("warning : %s\n", error->message);
                        LOGD("debug : %s\n", debug);
 
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_WARNING, NULL );
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_WARNING, NULL);
 
-                       MMPLAYER_FREEIF( debug );
-                       g_error_free( error );
+                       MMPLAYER_FREEIF(debug);
+                       g_error_free(error);
                }
                break;
 
                case GST_MESSAGE_TAG:
                {
                        LOGD("GST_MESSAGE_TAG\n");
-                       if ( ! __mmplayer_gst_extract_tag_from_msg( player, msg ) )
+                       if (!__mmplayer_gst_extract_tag_from_msg(player, msg))
                        {
                                LOGW("failed to extract tags from gstmessage\n");
                        }
@@ -1455,7 +1455,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        /* ignore the buffering messages during building pipeline, *
                         * not to block the main loop                              */
                        if (MMPLAYER_CURRENT_STATE(player) <= MM_PLAYER_STATE_READY) {
-                               LOGW("ignore the buffering msg (state:%d)", MMPLAYER_CURRENT_STATE(player));
+                               LOGW("ignore the buffering msg(state:%d)", MMPLAYER_CURRENT_STATE(player));
                                break;
                        }
 
@@ -1464,24 +1464,24 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        {
                                gint buffer_percent = 0;
 
-                               gst_message_parse_buffering (msg, &buffer_percent);
+                               gst_message_parse_buffering(msg, &buffer_percent);
 
                                if (buffer_percent == MAX_BUFFER_PERCENT)
                                {
-                                       LOGD ("Ignored all the previous buffering msg! (got %d%%)\n", buffer_percent);
+                                       LOGD("Ignored all the previous buffering msg!(got %d%%)\n", buffer_percent);
                                        player->streamer->is_buffering_done = FALSE;
                                }
 
                                break;
                        }
 
-                       MMPLAYER_CMD_LOCK( player );
+                       MMPLAYER_CMD_LOCK(player);
                        __mmplayer_update_buffer_setting(player, msg);
 
-                       if(__mmplayer_handle_buffering_message ( player ) == MM_ERROR_NONE) {
+                       if (__mmplayer_handle_buffering_message(player) == MM_ERROR_NONE) {
 
                                msg_param.connection.buffering = player->streamer->buffering_percent;
-                               MMPLAYER_POST_MSG ( player, MM_MESSAGE_BUFFERING, &msg_param );
+                               MMPLAYER_POST_MSG(player, MM_MESSAGE_BUFFERING, &msg_param);
                                if (MMPLAYER_IS_RTSP_STREAMING(player) &&
                                                (player->streamer->buffering_percent >= MAX_BUFFER_PERCENT))
                                {
@@ -1490,7 +1490,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                                if (MMPLAYER_TARGET_STATE(player) == MM_PLAYER_STATE_PAUSED)
                                                {
                                                        player->doing_seek = FALSE;
-                                                       MMPLAYER_POST_MSG ( player, MM_MESSAGE_SEEK_COMPLETED, NULL );
+                                                       MMPLAYER_POST_MSG(player, MM_MESSAGE_SEEK_COMPLETED, NULL);
                                                }
                                                else if (MMPLAYER_TARGET_STATE(player) == MM_PLAYER_STATE_PLAYING)
                                                {
@@ -1499,7 +1499,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                        }
                                }
                        }
-                       MMPLAYER_CMD_UNLOCK( player );
+                       MMPLAYER_CMD_UNLOCK(player);
                }
                break;
 
@@ -1511,7 +1511,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        GstState newstate = GST_STATE_NULL;
                        GstState pending = GST_STATE_NULL;
 
-                       if ( ! ( player->pipeline && player->pipeline->mainbin ) )
+                       if (!(player->pipeline && player->pipeline->mainbin))
                        {
                                LOGE("player pipeline handle is null");
                                break;
@@ -1520,13 +1520,13 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        mainbin = player->pipeline->mainbin;
 
                        /* we only handle messages from pipeline */
-                       if( msg->src != (GstObject *)mainbin[MMPLAYER_M_PIPE].gst )
+                       if (msg->src != (GstObject *)mainbin[MMPLAYER_M_PIPE].gst)
                                break;
 
                        /* get state info from msg */
-                       voldstate = gst_structure_get_value (gst_message_get_structure(msg), "old-state");
-                       vnewstate = gst_structure_get_value (gst_message_get_structure(msg), "new-state");
-                       vpending = gst_structure_get_value (gst_message_get_structure(msg), "pending-state");
+                       voldstate = gst_structure_get_value(gst_message_get_structure(msg), "old-state");
+                       vnewstate = gst_structure_get_value(gst_message_get_structure(msg), "new-state");
+                       vpending = gst_structure_get_value(gst_message_get_structure(msg), "pending-state");
 
                        if (!voldstate || !vnewstate) {
                                LOGE("received msg has wrong format.");
@@ -1540,9 +1540,9 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
 
                        LOGD("state changed [%s] : %s ---> %s     final : %s\n",
                                GST_OBJECT_NAME(GST_MESSAGE_SRC(msg)),
-                               gst_element_state_get_name( (GstState)oldstate ),
-                               gst_element_state_get_name( (GstState)newstate ),
-                               gst_element_state_get_name( (GstState)pending ) );
+                               gst_element_state_get_name((GstState)oldstate),
+                               gst_element_state_get_name((GstState)newstate),
+                               gst_element_state_get_name((GstState)pending));
 
                        if (oldstate == newstate)
                        {
@@ -1550,7 +1550,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                break;
                        }
 
-                       switch(newstate)
+                       switch (newstate)
                        {
                                case GST_STATE_VOID_PENDING:
                                break;
@@ -1565,7 +1565,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                {
                                        gboolean prepare_async = FALSE;
 
-                                       if ( ! player->audio_cb_probe_id && player->set_mode.pcm_extraction && !player->audio_stream_render_cb_ex)
+                                       if (!player->audio_cb_probe_id && player->set_mode.pcm_extraction && !player->audio_stream_render_cb_ex)
                                                __mmplayer_configure_audio_callback(player);
 
                                        if (!player->sent_bos && oldstate == GST_STATE_READY) // managed prepare async case
@@ -1574,9 +1574,9 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                                LOGD("checking prepare mode for async transition - %d", prepare_async);
                                        }
 
-                                       if ( MMPLAYER_IS_STREAMING(player) || MMPLAYER_IS_MS_BUFF_SRC(player) || prepare_async )
+                                       if (MMPLAYER_IS_STREAMING(player) || MMPLAYER_IS_MS_BUFF_SRC(player) || prepare_async)
                                        {
-                                               MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_PAUSED );
+                                               MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PAUSED);
 
                                                if (MMPLAYER_IS_STREAMING(player) && (player->streamer))
                                                {
@@ -1589,13 +1589,13 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
 
                                case GST_STATE_PLAYING:
                                {
-                                       if ( MMPLAYER_IS_STREAMING(player) ) // managed prepare async case when buffering is completed
+                                       if (MMPLAYER_IS_STREAMING(player)) // managed prepare async case when buffering is completed
                                        {
                                                // pending state should be reset oyherwise, it's still playing even though it's resumed after bufferging.
                                                if ((MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING) ||
                                                        (MMPLAYER_PENDING_STATE(player) == MM_PLAYER_STATE_PLAYING))
                                                {
-                                                       MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_PLAYING);
+                                                       MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PLAYING);
                                                }
                                        }
 
@@ -1609,7 +1609,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                        {
                                                player->doing_seek = FALSE;
                                                async_done = FALSE;
-                                               MMPLAYER_POST_MSG ( player, MM_MESSAGE_SEEK_COMPLETED, NULL );
+                                               MMPLAYER_POST_MSG(player, MM_MESSAGE_SEEK_COMPLETED, NULL);
                                        }
                                }
                                break;
@@ -1625,8 +1625,8 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                GstClock *clock = NULL;
                                gboolean need_new_clock = FALSE;
 
-                               gst_message_parse_clock_lost (msg, &clock);
-                               LOGD("GST_MESSAGE_CLOCK_LOST : %s\n", (clock ? GST_OBJECT_NAME (clock) : "NULL"));
+                               gst_message_parse_clock_lost(msg, &clock);
+                               LOGD("GST_MESSAGE_CLOCK_LOST : %s\n", (clock ? GST_OBJECT_NAME(clock) : "NULL"));
 
                                if (!player->videodec_linked)
                                {
@@ -1638,7 +1638,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                }
 
                                if (need_new_clock) {
-                                       LOGD ("Provide clock is TRUE, do pause->resume\n");
+                                       LOGD("Provide clock is TRUE, do pause->resume\n");
                                        __gst_pause(player, FALSE);
                                        __gst_resume(player, FALSE);
                                }
@@ -1648,8 +1648,8 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                case GST_MESSAGE_NEW_CLOCK:
                        {
                                GstClock *clock = NULL;
-                               gst_message_parse_new_clock (msg, &clock);
-                               LOGD("GST_MESSAGE_NEW_CLOCK : %s\n", (clock ? GST_OBJECT_NAME (clock) : "NULL"));
+                               gst_message_parse_new_clock(msg, &clock);
+                               LOGD("GST_MESSAGE_NEW_CLOCK : %s\n", (clock ? GST_OBJECT_NAME(clock) : "NULL"));
                        }
                        break;
 
@@ -1660,14 +1660,14 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                MMHandleType attrs = 0;
 
                                attrs = MMPLAYER_GET_ATTRS(player);
-                               if ( !attrs )
+                               if (!attrs)
                                {
                                        LOGE("cannot get content attribute");
                                        ret = FALSE;
                                        break;
                                }
 
-                               if(gst_message_get_structure(msg) == NULL)
+                               if (gst_message_get_structure(msg) == NULL)
                                        break;
 
                                structure_name = gst_structure_get_name(gst_message_get_structure(msg));
@@ -1679,12 +1679,12 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                        gint num_buffers = 0;
                                        gint extra_num_buffers = 0;
 
-                                       if (gst_structure_get_int (gst_message_get_structure(msg), "num_buffers", &num_buffers)) {
+                                       if (gst_structure_get_int(gst_message_get_structure(msg), "num_buffers", &num_buffers)) {
                                                player->video_num_buffers = num_buffers;
                                                LOGD("video_num_buffers : %d", player->video_num_buffers);
                                        }
 
-                                       if (gst_structure_get_int (gst_message_get_structure(msg), "extra_num_buffers", &extra_num_buffers)) {
+                                       if (gst_structure_get_int(gst_message_get_structure(msg), "extra_num_buffers", &extra_num_buffers)) {
                                                player->video_extra_num_buffers = extra_num_buffers;
                                                LOGD("num_of_vout_extra num buffers : %d", extra_num_buffers);
                                        }
@@ -1694,38 +1694,38 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                if (!strcmp(structure_name, "Language_list"))
                                {
                                        const GValue *lang_list = NULL;
-                                       lang_list = gst_structure_get_value (gst_message_get_structure(msg), "lang_list");
-                                       if(lang_list != NULL)
+                                       lang_list = gst_structure_get_value(gst_message_get_structure(msg), "lang_list");
+                                       if (lang_list != NULL)
                                        {
-                                               count = g_list_length((GList *)g_value_get_pointer (lang_list));
+                                               count = g_list_length((GList *)g_value_get_pointer(lang_list));
                                                if (count > 1)
-                                                       LOGD("Total audio tracks (from parser) = %d \n",count);
+                                                       LOGD("Total audio tracks(from parser) = %d \n",count);
                                        }
                                }
 
-                               if (!strcmp (structure_name, "Ext_Sub_Language_List"))
+                               if (!strcmp(structure_name, "Ext_Sub_Language_List"))
                                {
                                        const GValue *lang_list = NULL;
                                        MMPlayerLangStruct *temp = NULL;
 
-                                       lang_list = gst_structure_get_value (gst_message_get_structure(msg), "lang_list");
+                                       lang_list = gst_structure_get_value(gst_message_get_structure(msg), "lang_list");
                                        if (lang_list != NULL)
                                        {
-                                               count = g_list_length ((GList *)g_value_get_pointer (lang_list));
+                                               count = g_list_length((GList *)g_value_get_pointer(lang_list));
                                                if (count)
                                                {
-                                                       player->subtitle_language_list = (GList *)g_value_get_pointer (lang_list);
+                                                       player->subtitle_language_list = (GList *)g_value_get_pointer(lang_list);
                                                        mm_attrs_set_int_by_name(attrs, "content_text_track_num", (gint)count);
-                                                       if (mmf_attrs_commit (attrs))
+                                                       if (mmf_attrs_commit(attrs))
                                                          LOGE("failed to commit.\n");
                                                        LOGD("Total subtitle tracks = %d \n", count);
                                                }
                                                while (count)
                                                {
-                                                       temp = g_list_nth_data (player->subtitle_language_list, count - 1);
+                                                       temp = g_list_nth_data(player->subtitle_language_list, count - 1);
                                                        if (temp)
                                                        {
-                                                               LOGD ("value of lang_key is %s and lang_code is %s",
+                                                               LOGD("value of lang_key is %s and lang_code is %s",
                                                                                        temp->language_key, temp->language_code);
                                                        }
                                                        count--;
@@ -1734,7 +1734,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                }
 
                                /* custom message */
-                               if (!strcmp (structure_name, "audio_codec_not_supported")) {
+                               if (!strcmp(structure_name, "audio_codec_not_supported")) {
                                        MMMessageParamType msg_param = {0,};
                                        msg_param.code = MM_ERROR_PLAYER_AUDIO_CODEC_NOT_FOUND;
                                        MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
@@ -1765,7 +1765,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                        LOGD("GST_MESSAGE_ASYNC_DONE : %s\n", GST_ELEMENT_NAME(GST_MESSAGE_SRC(msg)));
 
                        /* we only handle messages from pipeline */
-                       if( msg->src != (GstObject *)player->pipeline->mainbin[MMPLAYER_M_PIPE].gst )
+                       if (msg->src != (GstObject *)player->pipeline->mainbin[MMPLAYER_M_PIPE].gst)
                                break;
 
                        if (player->doing_seek)
@@ -1773,7 +1773,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                if (MMPLAYER_TARGET_STATE(player) == MM_PLAYER_STATE_PAUSED)
                                {
                                        player->doing_seek = FALSE;
-                                       MMPLAYER_POST_MSG ( player, MM_MESSAGE_SEEK_COMPLETED, NULL );
+                                       MMPLAYER_POST_MSG(player, MM_MESSAGE_SEEK_COMPLETED, NULL);
                                }
                                else if (MMPLAYER_TARGET_STATE(player) == MM_PLAYER_STATE_PLAYING)
                                {
@@ -1788,12 +1788,12 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
 
                                                if (player->streamer->buffer_handle[BUFFER_TYPE_MUXED].buffer)
                                                {
-                                                       query = gst_query_new_buffering ( GST_FORMAT_PERCENT );
-                                                       if ( gst_element_query (player->streamer->buffer_handle[BUFFER_TYPE_MUXED].buffer, query ) )
+                                                       query = gst_query_new_buffering(GST_FORMAT_PERCENT);
+                                                       if (gst_element_query(player->streamer->buffer_handle[BUFFER_TYPE_MUXED].buffer, query))
                                                        {
-                                                               gst_query_parse_buffering_percent ( query, &busy, &percent);
+                                                               gst_query_parse_buffering_percent(query, &busy, &percent);
                                                        }
-                                                       gst_query_unref (query);
+                                                       gst_query_unref(query);
 
                                                        LOGD("buffered percent(%s): %d\n",
                                                                GST_ELEMENT_NAME(player->streamer->buffer_handle[BUFFER_TYPE_MUXED].buffer), percent);
@@ -1837,7 +1837,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
        /* FIXIT : this cause so many warnings/errors from glib/gstreamer. we should not call it since
         * gst_element_post_message api takes ownership of the message.
         */
-       //gst_message_unref( msg );
+       //gst_message_unref(msg);
 
        return ret;
 }
@@ -1866,7 +1866,7 @@ __mmplayer_gst_handle_duration(mm_player_t* player, GstMessage* msg)
        else
        {
                /* handling audio clip which has vbr. means duration is keep changing */
-               _mmplayer_update_content_attrs (player, ATTR_DURATION );
+               _mmplayer_update_content_attrs(player, ATTR_DURATION);
        }
 
        MMPLAYER_FLEAVE();
@@ -1885,7 +1885,7 @@ if (gst_tag_list_get_string(tag_list, gsttag, &string)) \
 {\
        if (string != NULL)\
        {\
-               SECURE_LOGD ( "update tag string : %s\n", string); \
+               SECURE_LOGD("update tag string : %s\n", string); \
                mm_attrs_set_string_by_name(attribute, playertag, string); \
                g_free(string);\
                string = NULL;\
@@ -1902,7 +1902,7 @@ if (gst_tag_list_get_sample_index(tag_list, gsttag, index, &sample))\
                LOGD("failed to get image data from tag");\
                return FALSE;\
        }\
-       SECURE_LOGD ( "update album cover data : %p, size : %d\n", info.data, info.size);\
+       SECURE_LOGD("update album cover data : %p, size : %d\n", info.data, info.size);\
        MMPLAYER_FREEIF(player->album_art); \
        player->album_art = (gchar *)g_malloc(info.size); \
        if (player->album_art) \
@@ -1913,8 +1913,8 @@ if (gst_tag_list_get_sample_index(tag_list, gsttag, index, &sample))\
                { \
                        msg_param.data = (void *)player->album_art; \
                        msg_param.size = info.size; \
-                       MMPLAYER_POST_MSG (player, MM_MESSAGE_IMAGE_BUFFER, &msg_param); \
-                       SECURE_LOGD ( "post message image buffer data : %p, size : %d\n", info.data, info.size); \
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_IMAGE_BUFFER, &msg_param); \
+                       SECURE_LOGD("post message image buffer data : %p, size : %d\n", info.data, info.size); \
                } \
        } \
        gst_buffer_unmap(buffer, &info); \
@@ -1923,7 +1923,7 @@ if (gst_tag_list_get_sample_index(tag_list, gsttag, index, &sample))\
 #define MMPLAYER_UPDATE_TAG_UINT(gsttag, attribute, playertag) \
 if (gst_tag_list_get_uint(tag_list, gsttag, &v_uint))\
 {\
-       if(v_uint)\
+       if (v_uint)\
        {\
                if (!strncmp(gsttag, GST_TAG_BITRATE, strlen(GST_TAG_BITRATE))) \
                {\
@@ -1935,7 +1935,7 @@ if (gst_tag_list_get_uint(tag_list, gsttag, &v_uint))\
                                player->total_bitrate += player->bitrate[player->updated_maximum_bitrate_count]; \
                                player->updated_bitrate_count++; \
                                mm_attrs_set_int_by_name(attribute, playertag, player->total_bitrate);\
-                               SECURE_LOGD ( "update bitrate %d[bps] of stream #%d.\n", v_uint, player->updated_bitrate_count);\
+                               SECURE_LOGD("update bitrate %d[bps] of stream #%d.\n", v_uint, player->updated_bitrate_count);\
                        }\
                }\
                else if (!strncmp(gsttag, GST_TAG_MAXIMUM_BITRATE, strlen(GST_TAG_MAXIMUM_BITRATE))) \
@@ -1946,7 +1946,7 @@ if (gst_tag_list_get_uint(tag_list, gsttag, &v_uint))\
                                player->total_maximum_bitrate += player->maximum_bitrate[player->updated_maximum_bitrate_count]; \
                                player->updated_maximum_bitrate_count++; \
                                mm_attrs_set_int_by_name(attribute, playertag, player->total_maximum_bitrate); \
-                               SECURE_LOGD ( "update maximum bitrate %d[bps] of stream #%d\n", v_uint, player->updated_maximum_bitrate_count);\
+                               SECURE_LOGD("update maximum bitrate %d[bps] of stream #%d\n", v_uint, player->updated_maximum_bitrate_count);\
                        }\
                }\
                else\
@@ -1964,16 +1964,16 @@ if (gst_tag_list_get_date(tag_list, gsttag, &date))\
        {\
                string = g_strdup_printf("%d", g_date_get_year(date));\
                mm_attrs_set_string_by_name(attribute, playertag, string);\
-               SECURE_LOGD ( "metainfo year : %s\n", string);\
+               SECURE_LOGD("metainfo year : %s\n", string);\
                MMPLAYER_FREEIF(string);\
                g_date_free(date);\
        }\
 }
 
 #define MMPLAYER_UPDATE_TAG_UINT64(gsttag, attribute, playertag) \
-if(gst_tag_list_get_uint64(tag_list, gsttag, &v_uint64))\
+if (gst_tag_list_get_uint64(tag_list, gsttag, &v_uint64))\
 {\
-       if(v_uint64)\
+       if (v_uint64)\
        {\
                /* FIXIT : don't know how to store date */\
                g_assert(1);\
@@ -1982,9 +1982,9 @@ if(gst_tag_list_get_uint64(tag_list, gsttag, &v_uint64))\
 }
 
 #define MMPLAYER_UPDATE_TAG_DOUBLE(gsttag, attribute, playertag) \
-if(gst_tag_list_get_double(tag_list, gsttag, &v_double))\
+if (gst_tag_list_get_double(tag_list, gsttag, &v_double))\
 {\
-       if(v_double)\
+       if (v_double)\
        {\
                /* FIXIT : don't know how to store date */\
                g_assert(1);\
@@ -2009,11 +2009,11 @@ if(gst_tag_list_get_double(tag_list, gsttag, &v_double))\
        //guint64 v_uint64 = 0;
        //gdouble v_double = 0;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player && msg, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && msg, FALSE);
 
        attrs = MMPLAYER_GET_ATTRS(player);
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( attrs, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(attrs, FALSE);
 
        /* get tag list from gst message */
        gst_message_parse_tag(msg, &tag_list);
@@ -2066,7 +2066,7 @@ if(gst_tag_list_get_double(tag_list, gsttag, &v_double))\
        /* MMPLAYER_UPDATE_TAG_DOUBLE(GST_TAG_BEATS_PER_MINUTE, ?, ?); */
        MMPLAYER_UPDATE_TAG_STRING(GST_TAG_IMAGE_ORIENTATION, attrs, "content_video_orientation");
 
-       if ( mmf_attrs_commit ( attrs ) )
+       if (mmf_attrs_commit(attrs))
                LOGE("failed to commit.\n");
 
        gst_tag_list_free(tag_list);
@@ -2075,7 +2075,7 @@ if(gst_tag_list_get_double(tag_list, gsttag, &v_double))\
 }
 
 static void
-__mmplayer_gst_rtp_no_more_pads (GstElement *element,  gpointer data)  // @
+__mmplayer_gst_rtp_no_more_pads(GstElement *element,  gpointer data)  // @
 {
        mm_player_t* player = (mm_player_t*) data;
 
@@ -2091,15 +2091,15 @@ __mmplayer_gst_rtp_no_more_pads (GstElement *element,  gpointer data)  // @
          * [3] typefinding has happend in audio but audiosink is created already before no-more-pad signal
          * and the video will be dumped via filesink.
          */
-       if ( player->num_dynamic_pad == 0 )
+       if (player->num_dynamic_pad == 0)
        {
                LOGD("it seems pad caps is directely used for autoplugging. removing fakesink now\n");
 
-               if ( ! __mmplayer_gst_remove_fakesink( player,
-                       &player->pipeline->mainbin[MMPLAYER_M_SRC_FAKESINK]) )
+               if (!__mmplayer_gst_remove_fakesink(player,
+                       &player->pipeline->mainbin[MMPLAYER_M_SRC_FAKESINK]))
                {
                        /* NOTE : __mmplayer_pipeline_complete() can be called several time. because
-                        * signaling mechanism ( pad-added, no-more-pad, new-decoded-pad ) from various
+                        * signaling mechanism(pad-added, no-more-pad, new-decoded-pad) from various
                         * source element are not same. To overcome this situation, this function will called
                         * several places and several times. Therefore, this is not an error case.
                         */
@@ -2108,7 +2108,7 @@ __mmplayer_gst_rtp_no_more_pads (GstElement *element,  gpointer data)  // @
        }
 
        /* create dot before error-return. for debugging */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-no-more-pad" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-no-more-pad");
 
        player->no_more_pad = TRUE;
 
@@ -2127,27 +2127,27 @@ __mmplayer_gst_remove_fakesink(mm_player_t* player, MMPlayerGstElement* fakesink
        MMPLAYER_RETURN_VAL_IF_FAIL(fakesink, TRUE);
 
        /* lock */
-       g_mutex_lock(&player->fsink_lock );
+       g_mutex_lock(&player->fsink_lock);
 
-       if ( ! fakesink->gst )
+       if (!fakesink->gst)
        {
                goto ERROR;
        }
 
        /* get parent of fakesink */
-       parent = (GstElement*)gst_object_get_parent( (GstObject*)fakesink->gst );
-       if ( ! parent )
+       parent = (GstElement*)gst_object_get_parent((GstObject*)fakesink->gst);
+       if (!parent)
        {
                LOGD("fakesink already removed\n");
                goto ERROR;
        }
 
-       gst_element_set_locked_state( fakesink->gst, TRUE );
+       gst_element_set_locked_state(fakesink->gst, TRUE);
 
        /* setting the state to NULL never returns async
         * so no need to wait for completion of state transiton
         */
-       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state (fakesink->gst, GST_STATE_NULL) )
+       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(fakesink->gst, GST_STATE_NULL))
        {
                LOGE("fakesink state change failure!\n");
 
@@ -2156,37 +2156,37 @@ __mmplayer_gst_remove_fakesink(mm_player_t* player, MMPlayerGstElement* fakesink
        }
 
        /* remove fakesink from it's parent */
-       if ( ! gst_bin_remove( GST_BIN( parent ), fakesink->gst ) )
+       if (!gst_bin_remove(GST_BIN(parent), fakesink->gst))
        {
                LOGE("failed to remove fakesink\n");
 
-               gst_object_unref( parent );
+               gst_object_unref(parent);
 
                goto ERROR;
        }
 
-       gst_object_unref( parent );
+       gst_object_unref(parent);
 
        LOGD("state-holder removed\n");
 
-       gst_element_set_locked_state( fakesink->gst, FALSE );
+       gst_element_set_locked_state(fakesink->gst, FALSE);
 
-       g_mutex_unlock( &player->fsink_lock );
+       g_mutex_unlock(&player->fsink_lock);
        return TRUE;
 
 ERROR:
-       if ( fakesink->gst )
+       if (fakesink->gst)
        {
-               gst_element_set_locked_state( fakesink->gst, FALSE );
+               gst_element_set_locked_state(fakesink->gst, FALSE);
        }
 
-       g_mutex_unlock( &player->fsink_lock );
+       g_mutex_unlock(&player->fsink_lock);
        return FALSE;
 }
 
 
 static void
-__mmplayer_gst_rtp_dynamic_pad (GstElement *element, GstPad *pad, gpointer data) // @
+__mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data) // @
 {
        GstPad *sinkpad = NULL;
        GstCaps* caps = NULL;
@@ -2198,10 +2198,10 @@ __mmplayer_gst_rtp_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL( element && pad );
+       MMPLAYER_RETURN_IF_FAIL(element && pad);
        MMPLAYER_RETURN_IF_FAIL(        player &&
                                        player->pipeline &&
-                                       player->pipeline->mainbin );
+                                       player->pipeline->mainbin);
 
 
        /* payload type is recognizable. increase num_dynamic and wait for sinkbin creation.
@@ -2210,32 +2210,32 @@ __mmplayer_gst_rtp_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
        player->num_dynamic_pad++;
        LOGD("stream count inc : %d\n", player->num_dynamic_pad);
 
-       caps = gst_pad_query_caps( pad, NULL );
+       caps = gst_pad_query_caps(pad, NULL);
 
-       MMPLAYER_CHECK_NULL( caps );
+       MMPLAYER_CHECK_NULL(caps);
 
        /* clear  previous result*/
        player->have_dynamic_pad = FALSE;
 
        str = gst_caps_get_structure(caps, 0);
 
-       if ( ! str )
+       if (!str)
        {
-               LOGE ("cannot get structure from caps.\n");
+               LOGE("cannot get structure from caps.\n");
                goto ERROR;
        }
 
-       name = gst_structure_get_name (str);
-       if ( ! name )
+       name = gst_structure_get_name(str);
+       if (!name)
        {
-               LOGE ("cannot get mimetype from structure.\n");
+               LOGE("cannot get mimetype from structure.\n");
                goto ERROR;
        }
 
        if (strstr(name, "video"))
        {
                gint stype = 0;
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &stype);
 
                if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE)
                {
@@ -2254,59 +2254,59 @@ __mmplayer_gst_rtp_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
        /* clear  previous result*/
        player->have_dynamic_pad = FALSE;
 
-       if ( !__mmplayer_try_to_plug_decodebin(player, pad, caps))
+       if (!__mmplayer_try_to_plug_decodebin(player, pad, caps))
        {
                LOGE("failed to autoplug for caps");
                goto ERROR;
        }
 
        /* check if there's dynamic pad*/
-       if( player->have_dynamic_pad )
+       if (player->have_dynamic_pad)
        {
                LOGE("using pad caps assums there's no dynamic pad !\n");
                goto ERROR;
        }
 
-       gst_caps_unref( caps );
+       gst_caps_unref(caps);
        caps = NULL;
 
 NEW_ELEMENT:
 
        /* excute new_element if created*/
-       if ( new_element )
+       if (new_element)
        {
                LOGD("adding new element to pipeline\n");
 
                /* set state to READY before add to bin */
-               MMPLAYER_ELEMENT_SET_STATE( new_element, GST_STATE_READY );
+               MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_READY);
 
                /* add new element to the pipeline */
-               if ( FALSE == gst_bin_add( GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), new_element)  )
+               if (FALSE == gst_bin_add(GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), new_element) )
                {
                        LOGE("failed to add autoplug element to bin\n");
                        goto ERROR;
                }
 
                /* get pad from element */
-               sinkpad = gst_element_get_static_pad ( GST_ELEMENT(new_element), "sink" );
-               if ( !sinkpad )
+               sinkpad = gst_element_get_static_pad(GST_ELEMENT(new_element), "sink");
+               if (!sinkpad)
                {
                        LOGE("failed to get sinkpad from autoplug element\n");
                        goto ERROR;
                }
 
                /* link it */
-               if ( GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad) )
+               if (GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad))
                {
                        LOGE("failed to link autoplug element\n");
                        goto ERROR;
                }
 
-               gst_object_unref (sinkpad);
+               gst_object_unref(sinkpad);
                sinkpad = NULL;
 
                /* run. setting PLAYING here since streamming source is live source */
-               MMPLAYER_ELEMENT_SET_STATE( new_element, GST_STATE_PLAYING );
+               MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_PLAYING);
        }
 
        MMPLAYER_FLEAVE();
@@ -2316,13 +2316,13 @@ NEW_ELEMENT:
 STATE_CHANGE_FAILED:
 ERROR:
        /* FIXIT : take care if new_element has already added to pipeline */
-       if ( new_element )
+       if (new_element)
                gst_object_unref(GST_OBJECT(new_element));
 
-       if ( sinkpad )
+       if (sinkpad)
                gst_object_unref(GST_OBJECT(sinkpad));
 
-       if ( caps )
+       if (caps)
                gst_object_unref(GST_OBJECT(caps));
 
        /* FIXIT : how to inform this error to MSL ????? */
@@ -2336,7 +2336,7 @@ ERROR:
 /* FIXIT : check indent */
 #if 0
 static void
-__mmplayer_gst_wfd_dynamic_pad (GstElement *element, GstPad *pad, gpointer data) // @
+__mmplayer_gst_wfd_dynamic_pad(GstElement *element, GstPad *pad, gpointer data) // @
 {
   GstPad *sinkpad = NULL;
   GstCaps* caps = NULL;
@@ -2347,104 +2347,104 @@ __mmplayer_gst_wfd_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
 
   MMPLAYER_FENTER();
 
-  MMPLAYER_RETURN_IF_FAIL( element && pad );
-  MMPLAYER_RETURN_IF_FAIL(  player &&
+  MMPLAYER_RETURN_IF_FAIL(element && pad);
+  MMPLAYER_RETURN_IF_FAIL( player &&
           player->pipeline &&
-          player->pipeline->mainbin );
+          player->pipeline->mainbin);
 
   LOGD("stream count inc : %d\n", player->num_dynamic_pad);
 
   {
     LOGD("using pad caps to autopluging instead of doing typefind\n");
-    caps = gst_pad_query_caps( pad );
-    MMPLAYER_CHECK_NULL( caps );
+    caps = gst_pad_query_caps(pad);
+    MMPLAYER_CHECK_NULL(caps);
     /* clear  previous result*/
     player->have_dynamic_pad = FALSE;
     new_element = gst_element_factory_make("rtpmp2tdepay", "wfd_rtp_depay");
-    if ( !new_element )
+    if (!new_element)
     {
-      LOGE ( "failed to create wfd rtp depay element\n" );
+      LOGE("failed to create wfd rtp depay element\n");
       goto ERROR;
     }
-    MMPLAYER_ELEMENT_SET_STATE( new_element, GST_STATE_READY );
+    MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_READY);
     /* add new element to the pipeline */
-    if ( FALSE == gst_bin_add( GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), new_element)  )
+    if (FALSE == gst_bin_add(GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), new_element) )
     {
       LOGD("failed to add autoplug element to bin\n");
       goto ERROR;
     }
     /* get pad from element */
-    sinkpad = gst_element_get_static_pad ( GST_ELEMENT(new_element), "sink" );
-    if ( !sinkpad )
+    sinkpad = gst_element_get_static_pad(GST_ELEMENT(new_element), "sink");
+    if (!sinkpad)
     {
       LOGD("failed to get sinkpad from autoplug element\n");
       goto ERROR;
     }
     /* link it */
-    if ( GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad) )
+    if (GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad))
     {
       LOGD("failed to link autoplug element\n");
       goto ERROR;
     }
-    gst_object_unref (sinkpad);
+    gst_object_unref(sinkpad);
     sinkpad = NULL;
-    pad = gst_element_get_static_pad ( GST_ELEMENT(new_element), "src" );
-    caps = gst_pad_query_caps( pad );
-    MMPLAYER_CHECK_NULL( caps );
-    MMPLAYER_ELEMENT_SET_STATE( new_element, GST_STATE_PLAYING );
+    pad = gst_element_get_static_pad(GST_ELEMENT(new_element), "src");
+    caps = gst_pad_query_caps(pad);
+    MMPLAYER_CHECK_NULL(caps);
+    MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_PLAYING);
     /* create typefind */
-    new_element = gst_element_factory_make( "typefind", NULL );
-    if ( ! new_element )
+    new_element = gst_element_factory_make("typefind", NULL);
+    if (!new_element)
     {
       LOGD("failed to create typefind\n");
       goto ERROR;
     }
 
-    MMPLAYER_SIGNAL_CONNECT(   player,
+    MMPLAYER_SIGNAL_CONNECT(  player,
                 G_OBJECT(new_element),
                 MM_PLAYER_SIGNAL_TYPE_AUTOPLUG,
                 "have-type",
                 G_CALLBACK(__mmplayer_typefind_have_type),
-                (gpointer)player);
+               (gpointer)player);
 
     player->have_dynamic_pad = FALSE;
   }
 
   /* excute new_element if created*/
-  if ( new_element )
+  if (new_element)
   {
     LOGD("adding new element to pipeline\n");
 
     /* set state to READY before add to bin */
-    MMPLAYER_ELEMENT_SET_STATE( new_element, GST_STATE_READY );
+    MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_READY);
 
     /* add new element to the pipeline */
-    if ( FALSE == gst_bin_add( GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), new_element)  )
+    if (FALSE == gst_bin_add(GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), new_element) )
     {
       LOGD("failed to add autoplug element to bin\n");
       goto ERROR;
     }
 
     /* get pad from element */
-    sinkpad = gst_element_get_static_pad ( GST_ELEMENT(new_element), "sink" );
-    if ( !sinkpad )
+    sinkpad = gst_element_get_static_pad(GST_ELEMENT(new_element), "sink");
+    if (!sinkpad)
     {
       LOGD("failed to get sinkpad from autoplug element\n");
       goto ERROR;
     }
 
     /* link it */
-    if ( GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad) )
+    if (GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad))
     {
       LOGD("failed to link autoplug element\n");
       goto ERROR;
     }
 
-    gst_object_unref (sinkpad);
+    gst_object_unref(sinkpad);
     sinkpad = NULL;
 
     /* run. setting PLAYING here since streamming source is live source */
-    MMPLAYER_ELEMENT_SET_STATE( new_element, GST_STATE_PLAYING );
+    MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_PLAYING);
   }
 
   /* store handle to futher manipulation */
@@ -2458,13 +2458,13 @@ __mmplayer_gst_wfd_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
 STATE_CHANGE_FAILED:
 ERROR:
   /* FIXIT : take care if new_element has already added to pipeline */
-  if ( new_element )
+  if (new_element)
     gst_object_unref(GST_OBJECT(new_element));
 
-  if ( sinkpad )
+  if (sinkpad)
     gst_object_unref(GST_OBJECT(sinkpad));
 
-  if ( caps )
+  if (caps)
     gst_object_unref(GST_OBJECT(caps));
 
   /* FIXIT : how to inform this error to MSL ????? */
@@ -2477,24 +2477,24 @@ ERROR:
 static GstPadProbeReturn
 __mmplayer_gst_selector_blocked(GstPad* pad, GstPadProbeInfo *info, gpointer data)
 {
-       LOGD ("pad(%s:%s) is blocked", GST_DEBUG_PAD_NAME(pad));
+       LOGD("pad(%s:%s) is blocked", GST_DEBUG_PAD_NAME(pad));
        return GST_PAD_PROBE_OK;
 }
 
 static GstPadProbeReturn
-__mmplayer_gst_selector_event_probe (GstPad * pad, GstPadProbeInfo * info, gpointer data)
+__mmplayer_gst_selector_event_probe(GstPad * pad, GstPadProbeInfo * info, gpointer data)
 {
        GstPadProbeReturn ret = GST_PAD_PROBE_OK;
-       GstEvent *event = GST_PAD_PROBE_INFO_DATA (info);
+       GstEvent *event = GST_PAD_PROBE_INFO_DATA(info);
        mm_player_t* player = (mm_player_t*)data;
        GstCaps* caps = NULL;
        GstStructure* str = NULL;
        const gchar* name = NULL;
        MMPlayerTrackType stream_type = MM_PLAYER_TRACK_TYPE_VIDEO;
 
-       if (GST_EVENT_TYPE (event) != GST_EVENT_STREAM_START &&
-               GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP &&
-               GST_EVENT_TYPE (event) != GST_EVENT_SEGMENT)
+       if (GST_EVENT_TYPE(event) != GST_EVENT_STREAM_START &&
+               GST_EVENT_TYPE(event) != GST_EVENT_FLUSH_STOP &&
+               GST_EVENT_TYPE(event) != GST_EVENT_SEGMENT)
                return ret;
 
        caps = gst_pad_query_caps(pad, NULL);
@@ -2527,7 +2527,7 @@ __mmplayer_gst_selector_event_probe (GstPad * pad, GstPadProbeInfo * info, gpoin
 
        LOGD("stream type is %d", stream_type);
 
-       switch (GST_EVENT_TYPE (event)) {
+       switch (GST_EVENT_TYPE(event)) {
                case GST_EVENT_STREAM_START:
                {
                        gint64 stop_running_time = 0;
@@ -2560,15 +2560,15 @@ __mmplayer_gst_selector_event_probe (GstPad * pad, GstPadProbeInfo * info, gpoin
                                }
 
                                position_running_time =
-                                       gst_segment_to_running_time (&player->gapless.segment[idx],
+                                       gst_segment_to_running_time(&player->gapless.segment[idx],
                                        GST_FORMAT_TIME, player->gapless.segment[idx].position);
 
                                LOGD("[type:%d] time info %" GST_TIME_FORMAT " , %"
                                        GST_TIME_FORMAT" , %" GST_TIME_FORMAT,
                                        idx,
-                                       GST_TIME_ARGS (stop_running_time),
-                                       GST_TIME_ARGS (position_running_time),
-                                       GST_TIME_ARGS(gst_segment_to_running_time (&player->gapless.segment[idx],
+                                       GST_TIME_ARGS(stop_running_time),
+                                       GST_TIME_ARGS(position_running_time),
+                                       GST_TIME_ARGS(gst_segment_to_running_time(&player->gapless.segment[idx],
                                        GST_FORMAT_TIME, player->gapless.segment[idx].start)));
 
                                position_running_time = MAX(position_running_time, stop_running_time);
@@ -2588,7 +2588,7 @@ __mmplayer_gst_selector_event_probe (GstPad * pad, GstPadProbeInfo * info, gpoin
                case GST_EVENT_FLUSH_STOP:
                {
                        LOGD("[%d] GST_EVENT_FLUSH_STOP", stream_type);
-                       gst_segment_init (&player->gapless.segment[stream_type], GST_FORMAT_UNDEFINED);
+                       gst_segment_init(&player->gapless.segment[stream_type], GST_FORMAT_UNDEFINED);
                        player->gapless.start_time[stream_type] = 0;
                        break;
                }
@@ -2597,7 +2597,7 @@ __mmplayer_gst_selector_event_probe (GstPad * pad, GstPadProbeInfo * info, gpoin
                        GstEvent *tmpev;
 
                        LOGD("[%d] GST_EVENT_SEGMENT", stream_type);
-                       gst_event_copy_segment (event, &segment);
+                       gst_event_copy_segment(event, &segment);
 
                        if (segment.format == GST_FORMAT_TIME)
                        {
@@ -2619,9 +2619,9 @@ __mmplayer_gst_selector_event_probe (GstPad * pad, GstPadProbeInfo * info, gpoin
 
                                LOGD("[%d] new base: %" GST_TIME_FORMAT, stream_type, GST_TIME_ARGS(player->gapless.segment[stream_type].base));
 
-                               tmpev = gst_event_new_segment (&player->gapless.segment[stream_type]);
-                               gst_event_set_seqnum (tmpev, gst_event_get_seqnum (event));
-                               gst_event_unref (event);
+                               tmpev = gst_event_new_segment(&player->gapless.segment[stream_type]);
+                               gst_event_set_seqnum(tmpev, gst_event_get_seqnum(event));
+                               gst_event_unref(event);
                                GST_PAD_PROBE_INFO_DATA(info) = tmpev;
                        }
                        break;
@@ -2637,7 +2637,7 @@ ERROR:
 }
 
 static void
-__mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
+__mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data)
 {
        mm_player_t* player = NULL;
        GstElement* pipeline = NULL;
@@ -2656,47 +2656,47 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
        /* check handles */
        player = (mm_player_t*)data;
 
-       MMPLAYER_RETURN_IF_FAIL (elem && pad);
-       MMPLAYER_RETURN_IF_FAIL (player && player->pipeline && player->pipeline->mainbin);
+       MMPLAYER_RETURN_IF_FAIL(elem && pad);
+       MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
 
-       //LOGD ("pad-added signal handling\n");
+       //LOGD("pad-added signal handling\n");
 
        pipeline = player->pipeline->mainbin[MMPLAYER_M_PIPE].gst;
 
        /* get mimetype from caps */
-       caps = gst_pad_query_caps (pad, NULL);
-       if ( !caps )
+       caps = gst_pad_query_caps(pad, NULL);
+       if (!caps)
        {
-               LOGE ("cannot get caps from pad.\n");
+               LOGE("cannot get caps from pad.\n");
                goto ERROR;
        }
 
-       str = gst_caps_get_structure (caps, 0);
-       if ( ! str )
+       str = gst_caps_get_structure(caps, 0);
+       if (!str)
        {
-               LOGE ("cannot get structure from caps.\n");
+               LOGE("cannot get structure from caps.\n");
                goto ERROR;
        }
 
-       name = gst_structure_get_name (str);
-       if ( ! name )
+       name = gst_structure_get_name(str);
+       if (!name)
        {
-               LOGE ("cannot get mimetype from structure.\n");
+               LOGE("cannot get mimetype from structure.\n");
                goto ERROR;
        }
 
        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
-       //LOGD ("detected mimetype : %s\n", name);
+       //LOGD("detected mimetype : %s\n", name);
 
        if (strstr(name, "video"))
        {
                gint stype = 0;
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &stype);
 
                /* don't make video because of not required, and not support multiple track */
                if (stype == MM_DISPLAY_SURFACE_NULL)
                {
-                       LOGD ("no video sink by null surface");
+                       LOGD("no video sink by null surface");
                        MMPlayerResourceState resource_state = RESOURCE_STATE_NONE;
                        if (_mmplayer_resource_manager_get_state(&player->resource_manager, &resource_state)
                                        == MM_ERROR_NONE)
@@ -2719,7 +2719,7 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
                        {
                                player->set_mode.video_zc = TRUE;
                        }
-                       MMPLAYER_FREEIF( caps_str );
+                       MMPLAYER_FREEIF(caps_str);
 
                        if (player->v_stream_caps)
                        {
@@ -2727,13 +2727,13 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
                                player->v_stream_caps = NULL;
                        }
 
-                       LOGD ("create fakesink instead of videobin");
+                       LOGD("create fakesink instead of videobin");
 
                        /* fake sink */
-                       fakesink = gst_element_factory_make ("fakesink", NULL);
+                       fakesink = gst_element_factory_make("fakesink", NULL);
                        if (fakesink == NULL)
                        {
-                               LOGE ("ERROR : fakesink create error\n");
+                               LOGE("ERROR : fakesink create error\n");
                                goto ERROR;
                        }
 
@@ -2745,15 +2745,15 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
                        /* store it as it's sink element */
                        __mmplayer_add_sink(player, player->video_fakesink);
 
-                       gst_bin_add (GST_BIN(pipeline), fakesink);
+                       gst_bin_add(GST_BIN(pipeline), fakesink);
 
                        // link
-                       sinkpad = gst_element_get_static_pad (fakesink, "sink");
+                       sinkpad = gst_element_get_static_pad(fakesink, "sink");
 
                        if (GST_PAD_LINK_OK != gst_pad_link(pad, sinkpad))
                        {
-                               LOGW ("failed to link fakesink\n");
-                               gst_object_unref (GST_OBJECT(fakesink));
+                               LOGW("failed to link fakesink\n");
+                               gst_object_unref(GST_OBJECT(fakesink));
                                goto ERROR;
                        }
 
@@ -2787,11 +2787,11 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
 
                if (MMPLAYER_IS_MS_BUFF_SRC(player))
                {
-                       __mmplayer_gst_decode_callback (elem, pad, player);
+                       __mmplayer_gst_decode_callback(elem, pad, player);
                        return;
                }
 
-               LOGD ("video selector \n");
+               LOGD("video selector \n");
                elemId = MMPLAYER_M_V_INPUT_SELECTOR;
                stream_type = MM_PLAYER_TRACK_TYPE_VIDEO;
        }
@@ -2804,54 +2804,54 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
 
                        if (MMPLAYER_IS_MS_BUFF_SRC(player))
                        {
-                               __mmplayer_gst_decode_callback (elem, pad, player);
+                               __mmplayer_gst_decode_callback(elem, pad, player);
                                return;
                        }
 
-                       LOGD ("audio selector \n");
+                       LOGD("audio selector \n");
                        elemId = MMPLAYER_M_A_INPUT_SELECTOR;
                        stream_type = MM_PLAYER_TRACK_TYPE_AUDIO;
 
-                       gst_structure_get_int (str, "rate", &samplerate);
-                       gst_structure_get_int (str, "channels", &channels);
+                       gst_structure_get_int(str, "rate", &samplerate);
+                       gst_structure_get_int(str, "channels", &channels);
 
                        if ((channels > 0 && samplerate == 0)) {//exclude audio decoding
                                /* fake sink */
-                               fakesink = gst_element_factory_make ("fakesink", NULL);
+                               fakesink = gst_element_factory_make("fakesink", NULL);
                                if (fakesink == NULL)
                                {
-                                       LOGE ("ERROR : fakesink create error\n");
+                                       LOGE("ERROR : fakesink create error\n");
                                        goto ERROR;
                                }
 
-                               gst_bin_add (GST_BIN(pipeline), fakesink);
+                               gst_bin_add(GST_BIN(pipeline), fakesink);
 
                                /* link */
-                               sinkpad = gst_element_get_static_pad (fakesink, "sink");
+                               sinkpad = gst_element_get_static_pad(fakesink, "sink");
 
                                if (GST_PAD_LINK_OK != gst_pad_link(pad, sinkpad))
                                {
-                                       LOGW ("failed to link fakesink\n");
-                                       gst_object_unref (GST_OBJECT(fakesink));
+                                       LOGW("failed to link fakesink\n");
+                                       gst_object_unref(GST_OBJECT(fakesink));
                                        goto ERROR;
                                }
 
-                               g_object_set (G_OBJECT (fakesink), "async", TRUE, NULL);
-                               g_object_set (G_OBJECT (fakesink), "sync", TRUE, NULL);
-                               gst_element_set_state (fakesink, GST_STATE_PAUSED);
+                               g_object_set(G_OBJECT(fakesink), "async", TRUE, NULL);
+                               g_object_set(G_OBJECT(fakesink), "sync", TRUE, NULL);
+                               gst_element_set_state(fakesink, GST_STATE_PAUSED);
 
                                goto DONE;
                        }
                }
                else if (strstr(name, "text"))
                {
-                       LOGD ("text selector \n");
+                       LOGD("text selector \n");
                        elemId = MMPLAYER_M_T_INPUT_SELECTOR;
                        stream_type = MM_PLAYER_TRACK_TYPE_TEXT;
                }
                else
                {
-                       LOGE ("wrong elem id \n");
+                       LOGE("wrong elem id \n");
                        goto ERROR;
                }
        }
@@ -2859,14 +2859,14 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
        selector = player->pipeline->mainbin[elemId].gst;
        if (selector == NULL)
        {
-               selector = gst_element_factory_make ("input-selector", NULL);
-               LOGD ("Creating input-selector\n");
+               selector = gst_element_factory_make("input-selector", NULL);
+               LOGD("Creating input-selector\n");
                if (selector == NULL)
                {
-                       LOGE ("ERROR : input-selector create error\n");
+                       LOGE("ERROR : input-selector create error\n");
                        goto ERROR;
                }
-               g_object_set (selector, "sync-streams", TRUE, NULL);
+               g_object_set(selector, "sync-streams", TRUE, NULL);
 
                player->pipeline->mainbin[elemId].id = elemId;
                player->pipeline->mainbin[elemId].gst = selector;
@@ -2874,36 +2874,36 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
                first_track = TRUE;
                // player->selector[stream_type].active_pad_index = DEFAULT_TRACK;      // default
 
-               srcpad = gst_element_get_static_pad (selector, "src");
+               srcpad = gst_element_get_static_pad(selector, "src");
 
-               LOGD ("blocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
+               LOGD("blocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
                player->selector[stream_type].block_id = gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
                        __mmplayer_gst_selector_blocked, NULL, NULL);
                player->selector[stream_type].event_probe_id = gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM|GST_PAD_PROBE_TYPE_EVENT_FLUSH,
                        __mmplayer_gst_selector_event_probe, player, NULL);
 
-               gst_element_set_state (selector, GST_STATE_PAUSED);
-               gst_bin_add (GST_BIN(pipeline), selector);
+               gst_element_set_state(selector, GST_STATE_PAUSED);
+               gst_bin_add(GST_BIN(pipeline), selector);
        } else
-               LOGD ("input-selector is already created.\n");
+               LOGD("input-selector is already created.\n");
 
        // link
-       LOGD ("Calling request pad with selector %p \n", selector);
-       sinkpad = gst_element_get_request_pad (selector, "sink_%u");
+       LOGD("Calling request pad with selector %p \n", selector);
+       sinkpad = gst_element_get_request_pad(selector, "sink_%u");
 
-       LOGD ("got pad %s:%s from selector", GST_DEBUG_PAD_NAME (sinkpad));
+       LOGD("got pad %s:%s from selector", GST_DEBUG_PAD_NAME(sinkpad));
 
        if (GST_PAD_LINK_OK != gst_pad_link(pad, sinkpad))
        {
-               LOGW ("failed to link selector\n");
-               gst_object_unref (GST_OBJECT(selector));
+               LOGW("failed to link selector\n");
+               gst_object_unref(GST_OBJECT(selector));
                goto ERROR;
        }
 
        if (first_track)
        {
-               LOGD ("this is first track --> active track \n");
-               g_object_set (selector, "active-pad", sinkpad, NULL);
+               LOGD("this is first track --> active track \n");
+               g_object_set(selector, "active-pad", sinkpad, NULL);
        }
 
        _mmplayer_track_update_info(player, stream_type, sinkpad);
@@ -2914,18 +2914,18 @@ ERROR:
 
        if (caps)
        {
-               gst_caps_unref (caps);
+               gst_caps_unref(caps);
        }
 
        if (sinkpad)
        {
-               gst_object_unref (GST_OBJECT(sinkpad));
+               gst_object_unref(GST_OBJECT(sinkpad));
                sinkpad = NULL;
        }
 
        if (srcpad)
        {
-               gst_object_unref (GST_OBJECT(srcpad));
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 
@@ -2939,14 +2939,14 @@ static void __mmplayer_handle_text_decode_path(mm_player_t* player, GstElement*
        gint active_index = 0;
 
        // [link] input-selector :: textbin
-       srcpad = gst_element_get_static_pad (text_selector, "src");
+       srcpad = gst_element_get_static_pad(text_selector, "src");
        if (!srcpad)
        {
                LOGE("failed to get srcpad from selector\n");
                return;
        }
 
-       LOGD ("got pad %s:%s from text selector\n", GST_DEBUG_PAD_NAME(srcpad));
+       LOGD("got pad %s:%s from text selector\n", GST_DEBUG_PAD_NAME(srcpad));
 
        active_index = player->selector[MM_PLAYER_TRACK_TYPE_TEXT].active_pad_index;
        if ((active_index != DEFAULT_TRACK) &&
@@ -2957,12 +2957,12 @@ static void __mmplayer_handle_text_decode_path(mm_player_t* player, GstElement*
        }
 
        player->no_more_pad = TRUE;
-       __mmplayer_gst_decode_callback (text_selector, srcpad, player);
+       __mmplayer_gst_decode_callback(text_selector, srcpad, player);
 
-       LOGD ("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
+       LOGD("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
        if (player->selector[MM_PLAYER_TRACK_TYPE_TEXT].block_id)
        {
-               gst_pad_remove_probe (srcpad, player->selector[MM_PLAYER_TRACK_TYPE_TEXT].block_id);
+               gst_pad_remove_probe(srcpad, player->selector[MM_PLAYER_TRACK_TYPE_TEXT].block_id);
                player->selector[MM_PLAYER_TRACK_TYPE_TEXT].block_id = 0;
        }
 
@@ -2972,10 +2972,10 @@ static void __mmplayer_handle_text_decode_path(mm_player_t* player, GstElement*
                player->has_closed_caption = TRUE;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( attrs )
+       if (attrs)
        {
-               mm_attrs_set_int_by_name(attrs, "content_text_track_num",(gint)player->selector[MM_PLAYER_TRACK_TYPE_TEXT].total_track_num);
-               if (mmf_attrs_commit (attrs))
+               mm_attrs_set_int_by_name(attrs, "content_text_track_num", (gint)player->selector[MM_PLAYER_TRACK_TYPE_TEXT].total_track_num);
+               if (mmf_attrs_commit(attrs))
                        LOGE("failed to commit.\n");
        }
        else
@@ -2985,7 +2985,7 @@ static void __mmplayer_handle_text_decode_path(mm_player_t* player, GstElement*
 
        if (srcpad)
        {
-               gst_object_unref ( GST_OBJECT(srcpad) );
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 }
@@ -3002,14 +3002,14 @@ int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel c
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       LOGD ("Change Audio mode to %d\n", ch_idx);
+       LOGD("Change Audio mode to %d\n", ch_idx);
        player->use_deinterleave = TRUE;
 
        if ((!player->pipeline) || (!player->pipeline->mainbin))
        {
-               LOGD ("pre setting : %d\n", ch_idx);
+               LOGD("pre setting : %d\n", ch_idx);
 
                player->audio_mode.active_pad_index = ch_idx;
                return result;
@@ -3021,58 +3021,58 @@ int _mmplayer_gst_set_audio_channel(MMHandleType hplayer, MMPlayerAudioChannel c
        {
                if (player->max_audio_channels < 2)
                {
-                       LOGD ("mono channel track only\n");
+                       LOGD("mono channel track only\n");
                        return result;
                }
 
-               LOGW ("selector doesn't exist\n");
+               LOGW("selector doesn't exist\n");
                return result;  /* keep playing */
        }
 
-       LOGD ("total_ch_num : %d\n", player->audio_mode.total_track_num);
+       LOGD("total_ch_num : %d\n", player->audio_mode.total_track_num);
 
        if (player->audio_mode.total_track_num < 2)
        {
-               LOGW ("there is no another audio path\n");
+               LOGW("there is no another audio path\n");
                return result;  /* keep playing */
        }
 
        if ((ch_idx < 0) || (ch_idx >= player->audio_mode.total_track_num))
        {
-               LOGW ("Not a proper ch_idx : %d \n", ch_idx);
+               LOGW("Not a proper ch_idx : %d \n", ch_idx);
                return result;  /* keep playing */
        }
 
        /*To get the new pad from the selector*/
-       change_pad_name = g_strdup_printf ("sink%d", ch_idx);
+       change_pad_name = g_strdup_printf("sink%d", ch_idx);
        if (change_pad_name == NULL)
        {
-               LOGW ("Pad does not exists\n");
+               LOGW("Pad does not exists\n");
                goto ERROR;     /* keep playing */
        }
 
-       LOGD ("new active pad name: %s\n", change_pad_name);
+       LOGD("new active pad name: %s\n", change_pad_name);
 
-       sinkpad = gst_element_get_static_pad (mainbin[MMPLAYER_M_A_SELECTOR].gst, change_pad_name);
+       sinkpad = gst_element_get_static_pad(mainbin[MMPLAYER_M_A_SELECTOR].gst, change_pad_name);
        if (sinkpad == NULL)
        {
                //result = MM_ERROR_PLAYER_INTERNAL;
                goto ERROR;     /* keep playing */
        }
 
-       LOGD ("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
-       g_object_set (mainbin[MMPLAYER_M_A_SELECTOR].gst, "active-pad", sinkpad, NULL);
+       LOGD("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
+       g_object_set(mainbin[MMPLAYER_M_A_SELECTOR].gst, "active-pad", sinkpad, NULL);
 
        caps = gst_pad_get_current_caps(sinkpad);
        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
 
-       __mmplayer_set_audio_attrs (player, caps);
+       __mmplayer_set_audio_attrs(player, caps);
        player->audio_mode.active_pad_index = ch_idx;
 
 ERROR:
 
        if (sinkpad)
-               gst_object_unref (sinkpad);
+               gst_object_unref(sinkpad);
 
        MMPLAYER_FREEIF(change_pad_name);
 
@@ -3094,15 +3094,15 @@ __mmplayer_gst_deinterleave_pad_added(GstElement *elem, GstPad *pad, gpointer da
        gchar* caps_str= NULL;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL (player && player->pipeline && player->pipeline->mainbin);
+       MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
 
        caps_str = gst_caps_to_string(gst_pad_get_current_caps(pad));
-       LOGD ("deinterleave new caps : %s\n", caps_str);
+       LOGD("deinterleave new caps : %s\n", caps_str);
        MMPLAYER_FREEIF(caps_str);
 
        if ((queue = __mmplayer_element_create_and_link(player, pad, "queue")) == NULL)
        {
-               LOGE ("ERROR : queue create error\n");
+               LOGE("ERROR : queue create error\n");
                goto ERROR;
        }
 
@@ -3120,31 +3120,31 @@ __mmplayer_gst_deinterleave_pad_added(GstElement *elem, GstPad *pad, gpointer da
                goto ERROR;
        }
 
-       srcpad = gst_element_get_static_pad (queue, "src");
-       sinkpad = gst_element_get_request_pad (selector, "sink_%u");
+       srcpad = gst_element_get_static_pad(queue, "src");
+       sinkpad = gst_element_get_request_pad(selector, "sink_%u");
 
-       LOGD ("link (%s:%s - %s:%s)\n", GST_DEBUG_PAD_NAME(srcpad), GST_DEBUG_PAD_NAME(sinkpad));
+       LOGD("link(%s:%s - %s:%s)\n", GST_DEBUG_PAD_NAME(srcpad), GST_DEBUG_PAD_NAME(sinkpad));
 
        if (GST_PAD_LINK_OK != gst_pad_link(srcpad, sinkpad))
        {
-               LOGW ("failed to link deinterleave - selector\n");
+               LOGW("failed to link deinterleave - selector\n");
                goto ERROR;
        }
 
-       gst_element_set_state (queue, GST_STATE_PAUSED);
+       gst_element_set_state(queue, GST_STATE_PAUSED);
        player->audio_mode.total_track_num++;
 
 ERROR:
 
        if (srcpad)
        {
-               gst_object_unref ( GST_OBJECT(srcpad) );
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 
        if (sinkpad)
        {
-               gst_object_unref ( GST_OBJECT(sinkpad) );
+               gst_object_unref(GST_OBJECT(sinkpad));
                sinkpad = NULL;
        }
 
@@ -3153,7 +3153,7 @@ ERROR:
 }
 
 static void
-__mmplayer_gst_deinterleave_no_more_pads (GstElement *elem, gpointer data)
+__mmplayer_gst_deinterleave_no_more_pads(GstElement *elem, gpointer data)
 {
        mm_player_t* player = NULL;
        GstElement* selector = NULL;
@@ -3181,40 +3181,40 @@ __mmplayer_gst_deinterleave_no_more_pads (GstElement *elem, gpointer data)
                gint audio_ch = default_audio_ch;
 
                /*To get the new pad from the selector*/
-               change_pad_name = g_strdup_printf ("sink%d", active_index);
+               change_pad_name = g_strdup_printf("sink%d", active_index);
                if (change_pad_name != NULL)
                {
-                       sinkpad = gst_element_get_static_pad (selector, change_pad_name);
+                       sinkpad = gst_element_get_static_pad(selector, change_pad_name);
                        if (sinkpad != NULL)
                        {
-                               LOGD ("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
-                               g_object_set (selector, "active-pad", sinkpad, NULL);
+                               LOGD("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
+                               g_object_set(selector, "active-pad", sinkpad, NULL);
 
                                audio_ch = active_index;
 
                                caps = gst_pad_get_current_caps(sinkpad);
                                MMPLAYER_LOG_GST_CAPS_TYPE(caps);
 
-                               __mmplayer_set_audio_attrs (player, caps);
+                               __mmplayer_set_audio_attrs(player, caps);
                        }
                        MMPLAYER_FREEIF(change_pad_name);
                }
 
                player->audio_mode.active_pad_index = audio_ch;
-               LOGD("audio LR info (0:stereo) = %d\n", player->audio_mode.active_pad_index);
+               LOGD("audio LR info(0:stereo) = %d\n", player->audio_mode.active_pad_index);
        }
 
 ERROR:
 
        if (sinkpad)
-               gst_object_unref (sinkpad);
+               gst_object_unref(sinkpad);
 
        MMPLAYER_FLEAVE();
        return;
 }
 
 static void
-__mmplayer_gst_build_deinterleave_path (GstElement *elem, GstPad *pad, gpointer data)
+__mmplayer_gst_build_deinterleave_path(GstElement *elem, GstPad *pad, gpointer data)
 {
        mm_player_t* player = NULL;
        MMPlayerGstElement *mainbin = NULL;
@@ -3238,28 +3238,28 @@ __mmplayer_gst_build_deinterleave_path (GstElement *elem, GstPad *pad, gpointer
        /* check handles */
        player = (mm_player_t*) data;
 
-       MMPLAYER_RETURN_IF_FAIL( elem && pad );
-       MMPLAYER_RETURN_IF_FAIL( player && player->pipeline && player->pipeline->mainbin );
+       MMPLAYER_RETURN_IF_FAIL(elem && pad);
+       MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
 
        mainbin = player->pipeline->mainbin;
 
        /* tee */
        if ((tee = __mmplayer_element_create_and_link(player, pad, "tee")) == NULL)
        {
-               LOGE ("ERROR : tee create error\n");
+               LOGE("ERROR : tee create error\n");
                goto ERROR;
        }
 
        mainbin[MMPLAYER_M_A_TEE].id = MMPLAYER_M_A_TEE;
        mainbin[MMPLAYER_M_A_TEE].gst = tee;
 
-       gst_element_set_state (tee, GST_STATE_PAUSED);
+       gst_element_set_state(tee, GST_STATE_PAUSED);
 
        /* queue */
-       srcpad = gst_element_get_request_pad (tee, "src_%u");
+       srcpad = gst_element_get_request_pad(tee, "src_%u");
        if ((stereo_queue = __mmplayer_element_create_and_link(player, srcpad, "queue")) == NULL)
        {
-               LOGE ("ERROR : stereo queue create error\n");
+               LOGE("ERROR : stereo queue create error\n");
                goto ERROR;
        }
 
@@ -3274,15 +3274,15 @@ __mmplayer_gst_build_deinterleave_path (GstElement *elem, GstPad *pad, gpointer
 
        if (srcpad)
        {
-               gst_object_unref (GST_OBJECT(srcpad));
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 
-       srcpad = gst_element_get_request_pad (tee, "src_%u");
+       srcpad = gst_element_get_request_pad(tee, "src_%u");
 
        if ((mono_queue = __mmplayer_element_create_and_link(player, srcpad, "queue")) == NULL)
        {
-               LOGE ("ERROR : mono queue create error\n");
+               LOGE("ERROR : mono queue create error\n");
                goto ERROR;
        }
 
@@ -3295,14 +3295,14 @@ __mmplayer_gst_build_deinterleave_path (GstElement *elem, GstPad *pad, gpointer
        player->pipeline->mainbin[MMPLAYER_M_A_Q2].id = MMPLAYER_M_A_Q2;
        player->pipeline->mainbin[MMPLAYER_M_A_Q2].gst = mono_queue;
 
-       gst_element_set_state (stereo_queue, GST_STATE_PAUSED);
-       gst_element_set_state (mono_queue, GST_STATE_PAUSED);
+       gst_element_set_state(stereo_queue, GST_STATE_PAUSED);
+       gst_element_set_state(mono_queue, GST_STATE_PAUSED);
 
        /* audioconvert */
-       srcpad = gst_element_get_static_pad (mono_queue, "src");
+       srcpad = gst_element_get_static_pad(mono_queue, "src");
        if ((conv = __mmplayer_element_create_and_link(player, srcpad, "audioconvert")) == NULL)
        {
-               LOGE ("ERROR : audioconvert create error\n");
+               LOGE("ERROR : audioconvert create error\n");
                goto ERROR;
        }
 
@@ -3312,124 +3312,124 @@ __mmplayer_gst_build_deinterleave_path (GstElement *elem, GstPad *pad, gpointer
        /* caps filter */
        if (srcpad)
        {
-               gst_object_unref (GST_OBJECT(srcpad));
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
-       srcpad = gst_element_get_static_pad (conv, "src");
+       srcpad = gst_element_get_static_pad(conv, "src");
 
        if ((filter = __mmplayer_element_create_and_link(player, srcpad, "capsfilter")) == NULL)
        {
-               LOGE ("ERROR : capsfilter create error\n");
+               LOGE("ERROR : capsfilter create error\n");
                goto ERROR;
        }
 
        player->pipeline->mainbin[MMPLAYER_M_A_FILTER].id = MMPLAYER_M_A_FILTER;
        player->pipeline->mainbin[MMPLAYER_M_A_FILTER].gst = filter;
 
-       caps = gst_caps_from_string( "audio/x-raw-int, "
+       caps = gst_caps_from_string("audio/x-raw-int, "
                                "width = (int) 16, "
                                "depth = (int) 16, "
                                "channels = (int) 2");
 
-       g_object_set (GST_ELEMENT(player->pipeline->mainbin[MMPLAYER_M_A_FILTER].gst), "caps", caps, NULL );
-       gst_caps_unref( caps );
+       g_object_set(GST_ELEMENT(player->pipeline->mainbin[MMPLAYER_M_A_FILTER].gst), "caps", caps, NULL);
+       gst_caps_unref(caps);
 
-       gst_element_set_state (conv, GST_STATE_PAUSED);
-       gst_element_set_state (filter, GST_STATE_PAUSED);
+       gst_element_set_state(conv, GST_STATE_PAUSED);
+       gst_element_set_state(filter, GST_STATE_PAUSED);
 
        /* deinterleave */
        if (srcpad)
        {
-               gst_object_unref (GST_OBJECT(srcpad));
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
-       srcpad = gst_element_get_static_pad (filter, "src");
+       srcpad = gst_element_get_static_pad(filter, "src");
 
        if ((deinterleave = __mmplayer_element_create_and_link(player, srcpad, "deinterleave")) == NULL)
        {
-               LOGE ("ERROR : deinterleave create error\n");
+               LOGE("ERROR : deinterleave create error\n");
                goto ERROR;
        }
 
-       g_object_set (deinterleave, "keep-positions", TRUE, NULL);
+       g_object_set(deinterleave, "keep-positions", TRUE, NULL);
 
-       MMPLAYER_SIGNAL_CONNECT (player, deinterleave, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
-                                                       G_CALLBACK (__mmplayer_gst_deinterleave_pad_added), player);
+       MMPLAYER_SIGNAL_CONNECT(player, deinterleave, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
+                                                       G_CALLBACK(__mmplayer_gst_deinterleave_pad_added), player);
 
-       MMPLAYER_SIGNAL_CONNECT (player, deinterleave, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
-                                                       G_CALLBACK (__mmplayer_gst_deinterleave_no_more_pads), player);
+       MMPLAYER_SIGNAL_CONNECT(player, deinterleave, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
+                                                       G_CALLBACK(__mmplayer_gst_deinterleave_no_more_pads), player);
 
        player->pipeline->mainbin[MMPLAYER_M_A_DEINTERLEAVE].id = MMPLAYER_M_A_DEINTERLEAVE;
        player->pipeline->mainbin[MMPLAYER_M_A_DEINTERLEAVE].gst = deinterleave;
 
        /* selector */
-       selector = gst_element_factory_make ("input-selector", "audio-channel-selector");
+       selector = gst_element_factory_make("input-selector", "audio-channel-selector");
        if (selector == NULL)
        {
-               LOGE ("ERROR : audio-selector create error\n");
+               LOGE("ERROR : audio-selector create error\n");
                goto ERROR;
        }
 
-       g_object_set (selector, "sync-streams", TRUE, NULL);
-       gst_bin_add (GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), selector);
+       g_object_set(selector, "sync-streams", TRUE, NULL);
+       gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), selector);
 
        player->pipeline->mainbin[MMPLAYER_M_A_SELECTOR].id = MMPLAYER_M_A_SELECTOR;
        player->pipeline->mainbin[MMPLAYER_M_A_SELECTOR].gst = selector;
 
-       selector_srcpad = gst_element_get_static_pad (selector, "src");
+       selector_srcpad = gst_element_get_static_pad(selector, "src");
 
-       LOGD ("blocking %s:%s", GST_DEBUG_PAD_NAME(selector_srcpad));
+       LOGD("blocking %s:%s", GST_DEBUG_PAD_NAME(selector_srcpad));
        block_id =
                gst_pad_add_probe(selector_srcpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
                        __mmplayer_gst_selector_blocked, NULL, NULL);
 
        if (srcpad)
        {
-               gst_object_unref (GST_OBJECT(srcpad));
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 
        srcpad = gst_element_get_static_pad(stereo_queue, "src");
-       sinkpad = gst_element_get_request_pad (selector, "sink_%u");
+       sinkpad = gst_element_get_request_pad(selector, "sink_%u");
 
        if (GST_PAD_LINK_OK != gst_pad_link(srcpad, sinkpad))
        {
-               LOGW ("failed to link queue_stereo - selector\n");
+               LOGW("failed to link queue_stereo - selector\n");
                goto ERROR;
        }
 
        player->audio_mode.total_track_num++;
 
-       g_object_set (selector, "active-pad", sinkpad, NULL);
-       gst_element_set_state (deinterleave, GST_STATE_PAUSED);
-       gst_element_set_state (selector, GST_STATE_PAUSED);
+       g_object_set(selector, "active-pad", sinkpad, NULL);
+       gst_element_set_state(deinterleave, GST_STATE_PAUSED);
+       gst_element_set_state(selector, GST_STATE_PAUSED);
 
-       __mmplayer_gst_decode_callback (selector, selector_srcpad, player);
+       __mmplayer_gst_decode_callback(selector, selector_srcpad, player);
 
 ERROR:
 
-       LOGD ("unblocking %s:%s", GST_DEBUG_PAD_NAME(selector_srcpad));
+       LOGD("unblocking %s:%s", GST_DEBUG_PAD_NAME(selector_srcpad));
        if (block_id != 0)
        {
-               gst_pad_remove_probe (selector_srcpad, block_id);
+               gst_pad_remove_probe(selector_srcpad, block_id);
                block_id = 0;
        }
 
        if (sinkpad)
        {
-               gst_object_unref (GST_OBJECT(sinkpad));
+               gst_object_unref(GST_OBJECT(sinkpad));
                sinkpad = NULL;
        }
 
        if (srcpad)
        {
-               gst_object_unref (GST_OBJECT(srcpad));
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 
        if (selector_srcpad)
        {
-               gst_object_unref (GST_OBJECT(selector_srcpad));
+               gst_object_unref(GST_OBJECT(selector_srcpad));
                selector_srcpad = NULL;
        }
 
@@ -3438,7 +3438,7 @@ ERROR:
 }
 
 static void
-__mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
+__mmplayer_gst_decode_no_more_pads(GstElement *elem, gpointer data)
 {
        mm_player_t* player = NULL;
        GstPad* srcpad = NULL;
@@ -3484,14 +3484,14 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
                guint buffer_bytes = init_buffering_time * ESTIMATED_BUFFER_UNIT;
 
                buffer_bytes = MAX(buffer_bytes, player->streamer->buffer_handle[BUFFER_TYPE_MUXED].buffering_bytes);
-               LOGD("[Decodebin2] set use-buffering on Q2 (pre buffer time: %d sec, buffer size : %d)\n", (gint)init_buffering_time, buffer_bytes);
+               LOGD("[Decodebin2] set use-buffering on Q2(pre buffer time: %d sec, buffer size : %d)\n", (gint)init_buffering_time, buffer_bytes);
 
                init_buffering_time = (init_buffering_time != 0)?(init_buffering_time):(player->ini.http_buffering_time);
 
-               if ( !gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
+               if (!gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
                        LOGE("fail to get duration.\n");
 
-               // enable use-buffering on queue2 instead of multiqueue (ex)audio only streaming
+               // enable use-buffering on queue2 instead of multiqueue(ex)audio only streaming
                // use file information was already set on Q2 when it was created.
                __mm_player_streaming_set_queue2(player->streamer,
                                                player->pipeline->mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst,
@@ -3511,23 +3511,23 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
        if (video_selector)
        {
                // [link] input-selector :: videobin
-               srcpad = gst_element_get_static_pad (video_selector, "src");
+               srcpad = gst_element_get_static_pad(video_selector, "src");
                if (!srcpad)
                {
                        LOGE("failed to get srcpad from video selector\n");
                        goto ERROR;
                }
 
-               LOGD ("got pad %s:%s from video selector\n", GST_DEBUG_PAD_NAME(srcpad));
+               LOGD("got pad %s:%s from video selector\n", GST_DEBUG_PAD_NAME(srcpad));
                if (!text_selector && !audio_selector)
                        player->no_more_pad = TRUE;
 
-               __mmplayer_gst_decode_callback (video_selector, srcpad, player);
+               __mmplayer_gst_decode_callback(video_selector, srcpad, player);
 
-               LOGD ("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
+               LOGD("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
                if (player->selector[MM_PLAYER_TRACK_TYPE_VIDEO].block_id)
                {
-                       gst_pad_remove_probe (srcpad, player->selector[MM_PLAYER_TRACK_TYPE_VIDEO].block_id);
+                       gst_pad_remove_probe(srcpad, player->selector[MM_PLAYER_TRACK_TYPE_VIDEO].block_id);
                        player->selector[MM_PLAYER_TRACK_TYPE_VIDEO].block_id = 0;
                }
        }
@@ -3543,23 +3543,23 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
                }
 
                // [link] input-selector :: audiobin
-               srcpad = gst_element_get_static_pad (audio_selector, "src");
+               srcpad = gst_element_get_static_pad(audio_selector, "src");
                if (!srcpad)
                {
                        LOGE("failed to get srcpad from selector\n");
                        goto ERROR;
                }
 
-               LOGD ("got pad %s:%s from selector\n", GST_DEBUG_PAD_NAME(srcpad));
+               LOGD("got pad %s:%s from selector\n", GST_DEBUG_PAD_NAME(srcpad));
                if (!text_selector)
                        player->no_more_pad = TRUE;
 
                if ((player->use_deinterleave == TRUE) && (player->max_audio_channels >= 2))
                {
-                       LOGD ("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
+                       LOGD("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
                        if (player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id)
                        {
-                               gst_pad_remove_probe (srcpad, player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id);
+                               gst_pad_remove_probe(srcpad, player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id);
                                player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id = 0;
                        }
 
@@ -3567,12 +3567,12 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
                }
                else
                {
-                       __mmplayer_gst_decode_callback (audio_selector, srcpad, player);
+                       __mmplayer_gst_decode_callback(audio_selector, srcpad, player);
 
-                       LOGD ("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
+                       LOGD("unblocking %s:%s", GST_DEBUG_PAD_NAME(srcpad));
                        if (player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id)
                        {
-                               gst_pad_remove_probe (srcpad, player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id);
+                               gst_pad_remove_probe(srcpad, player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id);
                                player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].block_id = 0;
                        }
                }
@@ -3580,10 +3580,10 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
                LOGD("Total audio tracks = %d \n", player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].total_track_num);
 
                attrs = MMPLAYER_GET_ATTRS(player);
-               if ( attrs )
+               if (attrs)
                {
-                       mm_attrs_set_int_by_name(attrs, "content_audio_track_num",(gint)player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].total_track_num);
-                       if (mmf_attrs_commit (attrs))
+                       mm_attrs_set_int_by_name(attrs, "content_audio_track_num", (gint)player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].total_track_num);
+                       if (mmf_attrs_commit(attrs))
                                LOGE("failed to commit.\n");
                }
                else
@@ -3595,18 +3595,18 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
        {
                if ((player->pipeline->audiobin) && (player->pipeline->audiobin[MMPLAYER_A_BIN].gst))
                {
-                       LOGD ("There is no audio track : remove audiobin");
+                       LOGD("There is no audio track : remove audiobin");
 
-                       __mmplayer_release_signal_connection( player, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN );
-                       __mmplayer_del_sink ( player, player->pipeline->audiobin[MMPLAYER_A_SINK].gst );
+                       __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN);
+                       __mmplayer_del_sink(player, player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
 
-                       MMPLAYER_RELEASE_ELEMENT ( player, player->pipeline->audiobin, MMPLAYER_A_BIN );
-                       MMPLAYER_FREEIF ( player->pipeline->audiobin )
+                       MMPLAYER_RELEASE_ELEMENT(player, player->pipeline->audiobin, MMPLAYER_A_BIN);
+                       MMPLAYER_FREEIF(player->pipeline->audiobin)
                }
 
                if (player->num_dynamic_pad == 0)
                {
-                       __mmplayer_pipeline_complete (NULL, player);
+                       __mmplayer_pipeline_complete(NULL, player);
                }
        }
 
@@ -3623,7 +3623,7 @@ __mmplayer_gst_decode_no_more_pads (GstElement *elem, gpointer data)
 ERROR:
        if (srcpad)
        {
-               gst_object_unref ( GST_OBJECT(srcpad) );
+               gst_object_unref(GST_OBJECT(srcpad));
                srcpad = NULL;
        }
 
@@ -3653,36 +3653,36 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
        /* check handles */
        player = (mm_player_t*) data;
 
-       MMPLAYER_RETURN_IF_FAIL( elem && pad );
+       MMPLAYER_RETURN_IF_FAIL(elem && pad);
        MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
 
        pipeline = player->pipeline->mainbin[MMPLAYER_M_PIPE].gst;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute\n");
                goto ERROR;
        }
 
        /* get mimetype from caps */
-       caps = gst_pad_query_caps( pad, NULL );
-       if ( !caps )
+       caps = gst_pad_query_caps(pad, NULL);
+       if (!caps)
        {
                LOGE("cannot get caps from pad.\n");
                goto ERROR;
        }
        caps_str = gst_caps_to_string(caps);
 
-       str = gst_caps_get_structure( caps, 0 );
-       if ( ! str )
+       str = gst_caps_get_structure(caps, 0);
+       if (!str)
        {
                LOGE("cannot get structure from caps.\n");
                goto ERROR;
        }
 
        name = gst_structure_get_name(str);
-       if ( ! name )
+       if (!name)
        {
                LOGE("cannot get mimetype from structure.\n");
                goto ERROR;
@@ -3708,7 +3708,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        reusing = TRUE;
                        sinkbin = player->pipeline->audiobin[MMPLAYER_A_BIN].gst;
                        LOGD("reusing audiobin\n");
-                       _mmplayer_update_content_attrs( player, ATTR_AUDIO);
+                       _mmplayer_update_content_attrs(player, ATTR_AUDIO);
                }
 
                if (player->selector[MM_PLAYER_TRACK_TYPE_AUDIO].total_track_num <= 0) // should not update if content have multi audio tracks
@@ -3716,8 +3716,8 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
 
                player->audiosink_linked  = 1;
 
-               sinkpad = gst_element_get_static_pad( GST_ELEMENT(sinkbin), "sink" );
-               if ( !sinkpad )
+               sinkpad = gst_element_get_static_pad(GST_ELEMENT(sinkbin), "sink");
+               if (!sinkpad)
                {
                        LOGE("failed to get pad from sinkbin\n");
                        goto ERROR;
@@ -3736,7 +3736,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        /* get video surface type */
                        int surface_type = 0;
                        mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
-                       LOGD("display_surface_type (%d)\n", surface_type);
+                       LOGD("display_surface_type(%d)\n", surface_type);
 
                        if (surface_type == MM_DISPLAY_SURFACE_NULL) {
                                LOGD("not make videobin because it dose not want\n");
@@ -3776,7 +3776,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                                }
                        }
 
-                       if (MM_ERROR_NONE !=  __mmplayer_gst_create_video_pipeline(player, caps, surface_type) )
+                       if (MM_ERROR_NONE !=  __mmplayer_gst_create_video_pipeline(player, caps, surface_type))
                        {
                                LOGE("failed to create videobin. continuing without video\n");
                                goto ERROR;
@@ -3790,7 +3790,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        reusing = TRUE;
                        sinkbin = player->pipeline->videobin[MMPLAYER_V_BIN].gst;
                        LOGD("re-using videobin\n");
-                       _mmplayer_update_content_attrs( player, ATTR_VIDEO);
+                       _mmplayer_update_content_attrs(player, ATTR_VIDEO);
                }
 
                /* FIXIT : track number shouldn't be hardcoded */
@@ -3798,24 +3798,24 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                player->videosink_linked  = 1;
 
                /* NOTE : intermediate code before doing H/W subtitle compositon */
-               if ( player->use_textoverlay && player->play_subtitle )
+               if (player->use_textoverlay && player->play_subtitle)
                {
                        LOGD("using textoverlay for external subtitle");
                        /* check text bin has created well */
-                       if ( player->pipeline && player->pipeline->textbin )
+                       if (player->pipeline && player->pipeline->textbin)
                        {
                                /* get sinkpad from textoverlay */
                                sinkpad = gst_element_get_static_pad(
                                        GST_ELEMENT(player->pipeline->textbin[MMPLAYER_T_BIN].gst),
-                                       "video_sink" );
-                               if ( ! sinkpad )
+                                       "video_sink");
+                               if (!sinkpad)
                                {
                                        LOGE("failed to get sink pad from textoverlay");
                                        goto ERROR;
                                }
 
                                /* link new pad with textoverlay first */
-                               if ( GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad) )
+                               if (GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad))
                                {
                                        LOGE("failed to get pad from sinkbin\n");
                                        goto ERROR;
@@ -3827,8 +3827,8 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                                /* alright, override pad to textbin.src for futher link */
                                pad = gst_element_get_static_pad(
                                        GST_ELEMENT(player->pipeline->textbin[MMPLAYER_T_BIN].gst),
-                                       "src" );
-                               if ( ! pad )
+                                       "src");
+                               if (!pad)
                                {
                                        LOGE("failed to get sink pad from textoverlay");
                                        goto ERROR;
@@ -3841,8 +3841,8 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        }
                }
 
-               sinkpad = gst_element_get_static_pad( GST_ELEMENT(sinkbin), "sink" );
-               if ( !sinkpad )
+               sinkpad = gst_element_get_static_pad(GST_ELEMENT(sinkbin), "sink");
+               if (!sinkpad)
                {
                        LOGE("failed to get pad from sinkbin\n");
                        goto ERROR;
@@ -3869,8 +3869,8 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        player->textsink_linked  = 1;
                        LOGI("player->textsink_linked set to 1\n");
 
-                       sinkpad = gst_element_get_static_pad( GST_ELEMENT(sinkbin), "text_sink" );
-                       if ( !sinkpad )
+                       sinkpad = gst_element_get_static_pad(GST_ELEMENT(sinkbin), "text_sink");
+                       if (!sinkpad)
                        {
                                LOGE("failed to get pad from sinkbin\n");
                                goto ERROR;
@@ -3882,18 +3882,18 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        {
                          /* input selector */
                          text_selector = gst_element_factory_make("input-selector", "subtitle_inselector");
-                         if ( !text_selector )
+                         if (!text_selector)
                          {
-                           LOGE ( "failed to create subtitle input selector element\n" );
+                           LOGE("failed to create subtitle input selector element\n");
                            goto ERROR;
                          }
-                         g_object_set (text_selector, "sync-streams", TRUE, NULL);
+                         g_object_set(text_selector, "sync-streams", TRUE, NULL);
 
                          mainbin[MMPLAYER_M_T_INPUT_SELECTOR].id = MMPLAYER_M_T_INPUT_SELECTOR;
                          mainbin[MMPLAYER_M_T_INPUT_SELECTOR].gst = text_selector;
 
                          /* warm up */
-                         if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (text_selector, GST_STATE_READY))
+                         if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(text_selector, GST_STATE_READY))
                          {
                            LOGE("failed to set state(READY) to sinkbin\n");
                            goto ERROR;
@@ -3905,12 +3905,12 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                            goto ERROR;
                          }
 
-                         LOGD ("created element input-selector");
+                         LOGD("created element input-selector");
 
                        }
                        else
                        {
-                         LOGD ("already having subtitle input selector");
+                         LOGD("already having subtitle input selector");
                          text_selector = mainbin[MMPLAYER_M_T_INPUT_SELECTOR].gst;
                        }
                }
@@ -3935,16 +3935,16 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
        }
        else
        {
-               LOGW("unknown type of elementary stream! ignoring it...\n");
+               LOGW("unknown type of elementary stream!ignoring it...\n");
                goto ERROR;
        }
 
-       if ( sinkbin )
+       if (sinkbin)
        {
-               if(!reusing)
+               if (!reusing)
                {
                        /* warm up */
-                       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state( sinkbin, GST_STATE_READY ) )
+                       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(sinkbin, GST_STATE_READY))
                        {
                                LOGE("failed to set state(READY) to sinkbin\n");
                                goto ERROR;
@@ -3952,7 +3952,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
 
                        /* Added for multi audio support to avoid adding audio bin again*/
                        /* add */
-                       if ( FALSE == gst_bin_add( GST_BIN(pipeline), sinkbin ) )
+                       if (FALSE == gst_bin_add(GST_BIN(pipeline), sinkbin))
                        {
                                LOGE("failed to add sinkbin to pipeline\n");
                                goto ERROR;
@@ -3960,7 +3960,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                }
 
                /* link */
-               if (GST_PAD_LINK_OK != GST_PAD_LINK (pad, sinkpad))
+               if (GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad))
                {
                        LOGE("failed to get pad from sinkbin\n");
                        goto ERROR;
@@ -3969,7 +3969,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                if (!reusing)
                {
                        /* run */
-                       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (sinkbin, GST_STATE_PAUSED))
+                       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(sinkbin, GST_STATE_PAUSED))
                        {
                                LOGE("failed to set state(PAUSED) to sinkbin\n");
                                goto ERROR;
@@ -3977,7 +3977,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
 
                        if (text_selector)
                        {
-                         if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (text_selector, GST_STATE_PAUSED))
+                         if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(text_selector, GST_STATE_PAUSED))
                          {
                            LOGE("failed to set state(PAUSED) to sinkbin\n");
                            goto ERROR;
@@ -3985,29 +3985,29 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        }
                }
 
-               gst_object_unref (sinkpad);
+               gst_object_unref(sinkpad);
                sinkpad = NULL;
        }
 
-       LOGD ("linking sink bin success\n");
+       LOGD("linking sink bin success\n");
 
        /* FIXIT : we cannot hold callback for 'no-more-pad' signal because signal was emitted in
         * streaming task. if the task blocked, then buffer will not flow to the next element
-        * ( autoplugging element ). so this is special hack for streaming. please try to remove it
+        *(autoplugging element). so this is special hack for streaming. please try to remove it
         */
        /* dec stream count. we can remove fakesink if it's zero */
        if (player->num_dynamic_pad)
                player->num_dynamic_pad--;
 
-       LOGD ("no more pads: %d stream count dec : %d (num of dynamic pad)\n", player->no_more_pad, player->num_dynamic_pad);
+       LOGD("no more pads: %d stream count dec : %d(num of dynamic pad)\n", player->no_more_pad, player->num_dynamic_pad);
 
        if ((player->no_more_pad) && (player->num_dynamic_pad == 0))
        {
-               __mmplayer_pipeline_complete (NULL, player);
+               __mmplayer_pipeline_complete(NULL, player);
        }
 
        /* FIXIT : please leave a note why this code is needed */
-       if(MMPLAYER_IS_WFD_STREAMING( player ))
+       if (MMPLAYER_IS_WFD_STREAMING(player))
        {
                player->no_more_pad = TRUE;
        }
@@ -4016,14 +4016,14 @@ ERROR:
 
        MMPLAYER_FREEIF(caps_str);
 
-       if ( caps )
-               gst_caps_unref( caps );
+       if (caps)
+               gst_caps_unref(caps);
 
-       if ( sinkpad )
+       if (sinkpad)
                gst_object_unref(GST_OBJECT(sinkpad));
 
        /* flusing out new attributes */
-       if (  mmf_attrs_commit ( attrs ) )
+       if ( mmf_attrs_commit(attrs))
        {
                LOGE("failed to comit attributes\n");
        }
@@ -4048,16 +4048,16 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
        }
 
        /* chech if supported or not */
-       if ( dest_angle % 90 )
+       if (dest_angle % 90)
        {
                LOGD("not supported rotation angle = %d", rotation_angle);
                return FALSE;
        }
 
        /*
-         * xvimagesink only     (A)
-         * custom_convert - no xv (e.g. memsink, evasimagesink  (B)
-         * videoflip - avsysmemsink (C)
+         * xvimagesink only    (A)
+         * custom_convert - no xv(e.g. memsink, evasimagesink  (B)
+         * videoflip - avsysmemsink(C)
          */
        if (player->set_mode.video_zc)
        {
@@ -4092,7 +4092,7 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
        }
 
        /* get property value for setting */
-       switch(rotation_type)
+       switch (rotation_type)
        {
                case ROTATION_USING_SINK: // xvimagesink, pixmap
                        {
@@ -4168,12 +4168,12 @@ int
 __mmplayer_video_param_check_video_sink_bin(mm_player_t* player)
 {
        /* check video sinkbin is created */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player &&
+       MMPLAYER_RETURN_VAL_IF_FAIL(player &&
                player->pipeline &&
                player->pipeline->videobin &&
                player->pipeline->videobin[MMPLAYER_V_BIN].gst &&
                player->pipeline->videobin[MMPLAYER_V_SINK].gst,
-               MM_ERROR_PLAYER_NOT_INITIALIZED );
+               MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        return MM_ERROR_NONE;
 }
@@ -4187,7 +4187,7 @@ __mmplayer_video_param_set_display_rotation(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return;
 
        __mmplayer_get_video_angle(player, &user_angle, &org_angle);
@@ -4206,11 +4206,11 @@ __mmplayer_video_param_set_display_visible(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       MMPLAYER_RETURN_IF_FAIL (attrs);
+       MMPLAYER_RETURN_IF_FAIL(attrs);
 
        mm_attrs_get_int_by_name(attrs, "display_visible", &visible);
        g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "visible", visible, NULL);
@@ -4225,11 +4225,11 @@ __mmplayer_video_param_set_display_method(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       MMPLAYER_RETURN_IF_FAIL (attrs);
+       MMPLAYER_RETURN_IF_FAIL(attrs);
 
        mm_attrs_get_int_by_name(attrs, "display_method", &display_method);
        g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "display-geometry-method", display_method, NULL);
@@ -4249,11 +4249,11 @@ __mmplayer_video_param_set_render_rectangle(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       MMPLAYER_RETURN_IF_FAIL (attrs);
+       MMPLAYER_RETURN_IF_FAIL(attrs);
 
        mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
 
@@ -4267,7 +4267,7 @@ __mmplayer_video_param_set_render_rectangle(mm_player_t* player)
 
                /* After setting window handle, set render      rectangle */
                gst_video_overlay_set_render_rectangle(
-                        GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ),
+                        GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
                         wl_window_x, wl_window_y, wl_window_width, wl_window_height);
                LOGD("set video param : render rectangle : x(%d) y(%d) width(%d) height(%d)",
                        wl_window_x, wl_window_y, wl_window_width, wl_window_height);
@@ -4285,11 +4285,11 @@ __mmplayer_video_param_set_display_overlay(mm_player_t* player)
        GstContext *context = NULL;
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       MMPLAYER_RETURN_IF_FAIL (attrs);
+       MMPLAYER_RETURN_IF_FAIL(attrs);
 
        /* common case if using overlay surface */
        mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
@@ -4300,8 +4300,8 @@ __mmplayer_video_param_set_display_overlay(mm_player_t* player)
                wl_surface_id = *(int*)handle;
                LOGD("set video param : wl_surface_id %d %p", wl_surface_id, *(int*)handle);
                gst_video_overlay_set_wl_window_wl_surface_id(
-                               GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ),
-                               *(int*)handle );
+                               GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+                               *(int*)handle);
        }
        else if (handle && use_wl_surface) /* use wl_surface for legacy_player_test */
        {
@@ -4314,8 +4314,8 @@ __mmplayer_video_param_set_display_overlay(mm_player_t* player)
                guintptr wl_surface = (guintptr)handle;
                LOGD("[use wl_surface for legacy_player_test] set video param : wayland surface %p", handle);
                gst_video_overlay_set_window_handle(
-                               GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ),
-                               wl_surface );
+                               GST_VIDEO_OVERLAY(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+                               wl_surface);
        }
        else
        {
@@ -4332,7 +4332,7 @@ __mmplayer_update_wayland_videosink_video_param(mm_player_t* player, char *param
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return MM_ERROR_PLAYER_NOT_INITIALIZED;
 
        if (strcmp(player->ini.videosink_element_overlay, "waylandsink"))
@@ -4342,7 +4342,7 @@ __mmplayer_update_wayland_videosink_video_param(mm_player_t* player, char *param
        }
 
        LOGD("param_name : %s", param_name);
-       if(!g_strcmp0(param_name, "update_all_param"))
+       if (!g_strcmp0(param_name, "update_all_param"))
        {
                update_all_param = TRUE;
        }
@@ -4351,7 +4351,7 @@ __mmplayer_update_wayland_videosink_video_param(mm_player_t* player, char *param
        {
                __mmplayer_video_param_set_display_overlay(player);
        }
-       if (update_all_param || !g_strcmp0(param_name, "wl_window_render_x") || !g_strcmp0(param_name, "display_overlay") )
+       if (update_all_param || !g_strcmp0(param_name, "wl_window_render_x") || !g_strcmp0(param_name, "display_overlay"))
        {
                __mmplayer_video_param_set_render_rectangle(player);
        }
@@ -4385,11 +4385,11 @@ __mmplayer_update_evas_videosink_video_param(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return MM_ERROR_PLAYER_NOT_INITIALIZED;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       MMPLAYER_RETURN_VAL_IF_FAIL (attrs, MM_ERROR_PLAYER_INTERNAL);
+       MMPLAYER_RETURN_VAL_IF_FAIL(attrs, MM_ERROR_PLAYER_INTERNAL);
 
        __mmplayer_get_video_angle(player, &user_angle, &org_angle);
 
@@ -4408,7 +4408,7 @@ __mmplayer_update_evas_videosink_video_param(mm_player_t* player)
                        if (user_angle != 0)
                        {
                                mm_attrs_set_int_by_name(attrs, "display_rotation", MM_DISPLAY_ROTATION_NONE);
-                               if (mmf_attrs_commit (attrs)) /* return -1 if error */
+                               if (mmf_attrs_commit(attrs)) /* return -1 if error */
                                        LOGE("failed to commit\n");
                                LOGW("unsupported feature");
                                return MM_ERROR_NOT_SUPPORT_API;
@@ -4482,11 +4482,11 @@ _mmplayer_update_video_param(mm_player_t* player, char *param_name) // @
        MMPLAYER_FENTER();
 
        /* check video sinkbin is created */
-       if(MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
+       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
                return MM_ERROR_PLAYER_NOT_INITIALIZED;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -4498,7 +4498,7 @@ _mmplayer_update_video_param(mm_player_t* player, char *param_name) // @
        LOGD("check display surface type attribute: %d", surface_type);
 
        /* configuring display */
-       switch ( surface_type )
+       switch (surface_type)
        {
                case MM_DISPLAY_SURFACE_OVERLAY:
                {
@@ -4546,11 +4546,11 @@ __mmplayer_gst_element_link_bucket(GList* element_bucket) // @
        prv_element = (MMPlayerGstElement*)bucket->data;
        bucket = bucket->next;
 
-       for ( ; bucket; bucket = bucket->next )
+       for (; bucket; bucket = bucket->next)
        {
                element = (MMPlayerGstElement*)bucket->data;
 
-               if ( element && element->gst )
+               if (element && element->gst)
                {
                        /* If next element is audio appsrc then make a separate audio pipeline */
                        if (!strcmp(GST_ELEMENT_NAME(GST_ELEMENT(element->gst)),"audio_appsrc") ||
@@ -4561,18 +4561,18 @@ __mmplayer_gst_element_link_bucket(GList* element_bucket) // @
                        }
 
                        if (prv_element && prv_element->gst) {
-                               if ( GST_ELEMENT_LINK(GST_ELEMENT(prv_element->gst), GST_ELEMENT(element->gst)) )
+                               if (GST_ELEMENT_LINK(GST_ELEMENT(prv_element->gst), GST_ELEMENT(element->gst)))
                                {
                                        LOGD("linking [%s] to [%s] success\n",
                                                GST_ELEMENT_NAME(GST_ELEMENT(prv_element->gst)),
-                                               GST_ELEMENT_NAME(GST_ELEMENT(element->gst)) );
+                                               GST_ELEMENT_NAME(GST_ELEMENT(element->gst)));
                                        successful_link_count ++;
                                }
                                else
                                {
                                        LOGD("linking [%s] to [%s] failed\n",
                                                GST_ELEMENT_NAME(GST_ELEMENT(prv_element->gst)),
-                                               GST_ELEMENT_NAME(GST_ELEMENT(element->gst)) );
+                                               GST_ELEMENT_NAME(GST_ELEMENT(element->gst)));
                                        return -1;
                                }
                        }
@@ -4598,17 +4598,17 @@ __mmplayer_gst_element_add_bucket_to_bin(GstBin* bin, GList* element_bucket) //
        MMPLAYER_RETURN_VAL_IF_FAIL(element_bucket, 0);
        MMPLAYER_RETURN_VAL_IF_FAIL(bin, 0);
 
-       for ( ; bucket; bucket = bucket->next )
+       for (; bucket; bucket = bucket->next)
        {
                element = (MMPlayerGstElement*)bucket->data;
 
-               if ( element && element->gst )
+               if (element && element->gst)
                {
-                       if( !gst_bin_add(bin, GST_ELEMENT(element->gst)) )
+                       if (!gst_bin_add(bin, GST_ELEMENT(element->gst)))
                        {
                                LOGD("__mmplayer_gst_element_link_bucket : Adding element [%s]  to bin [%s] failed\n",
                                        GST_ELEMENT_NAME(GST_ELEMENT(element->gst)),
-                                       GST_ELEMENT_NAME(GST_ELEMENT(bin) ) );
+                                       GST_ELEMENT_NAME(GST_ELEMENT(bin)));
                                return 0;
                        }
                        successful_add_count ++;
@@ -4620,7 +4620,7 @@ __mmplayer_gst_element_add_bucket_to_bin(GstBin* bin, GList* element_bucket) //
        return successful_add_count;
 }
 
-static void __mmplayer_gst_caps_notify_cb (GstPad * pad, GParamSpec * unused, gpointer data)
+static void __mmplayer_gst_caps_notify_cb(GstPad * pad, GParamSpec * unused, gpointer data)
 {
        mm_player_t* player = (mm_player_t*) data;
        GstCaps *caps = NULL;
@@ -4629,24 +4629,24 @@ static void __mmplayer_gst_caps_notify_cb (GstPad * pad, GParamSpec * unused, gp
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( pad )
-       MMPLAYER_RETURN_IF_FAIL ( unused )
-       MMPLAYER_RETURN_IF_FAIL ( data )
+       MMPLAYER_RETURN_IF_FAIL(pad)
+       MMPLAYER_RETURN_IF_FAIL(unused)
+       MMPLAYER_RETURN_IF_FAIL(data)
 
-       caps = gst_pad_get_current_caps( pad );
-       if ( !caps )
+       caps = gst_pad_get_current_caps(pad);
+       if (!caps)
        {
                return;
        }
 
        str = gst_caps_get_structure(caps, 0);
-       if ( !str )
+       if (!str)
        {
                goto ERROR;
        }
 
        name = gst_structure_get_name(str);
-       if ( !name )
+       if (!name)
        {
                goto ERROR;
        }
@@ -4655,7 +4655,7 @@ static void __mmplayer_gst_caps_notify_cb (GstPad * pad, GParamSpec * unused, gp
 
        if (strstr(name, "audio"))
        {
-               _mmplayer_update_content_attrs (player, ATTR_AUDIO);
+               _mmplayer_update_content_attrs(player, ATTR_AUDIO);
 
                if (player->audio_stream_changed_cb)
                {
@@ -4665,7 +4665,7 @@ static void __mmplayer_gst_caps_notify_cb (GstPad * pad, GParamSpec * unused, gp
        }
        else if (strstr(name, "video"))
        {
-               _mmplayer_update_content_attrs (player, ATTR_VIDEO);
+               _mmplayer_update_content_attrs(player, ATTR_VIDEO);
 
                if (player->video_stream_changed_cb)
                {
@@ -4701,7 +4701,7 @@ ERROR:
 #define MMPLAYER_CREATEONLY_ELEMENT(x_bin, x_id, x_factory, x_name) \
 x_bin[x_id].id = x_id;\
 x_bin[x_id].gst = gst_element_factory_make(x_factory, x_name);\
-if ( ! x_bin[x_id].gst )\
+if (!x_bin[x_id].gst)\
 {\
        LOGE("failed to create %s \n", x_factory);\
        goto ERROR;\
@@ -4710,7 +4710,7 @@ if ( ! x_bin[x_id].gst )\
 #define MMPLAYER_CREATE_ELEMENT_ADD_BIN(x_bin, x_id, x_factory, x_name, y_bin, x_player) \
 x_bin[x_id].id = x_id;\
 x_bin[x_id].gst = gst_element_factory_make(x_factory, x_name);\
-if ( ! x_bin[x_id].gst )\
+if (!x_bin[x_id].gst)\
 {\
        LOGE("failed to create %s \n", x_factory);\
        goto ERROR;\
@@ -4720,11 +4720,11 @@ else\
        if (x_player->ini.set_dump_element_flag)\
                __mmplayer_add_dump_buffer_probe(x_player, x_bin[x_id].gst);\
 }\
-if!gst_bin_add(GST_BIN(y_bin), GST_ELEMENT(x_bin[x_id].gst)))\
+if (!gst_bin_add(GST_BIN(y_bin), GST_ELEMENT(x_bin[x_id].gst)))\
 {\
        LOGD("__mmplayer_gst_element_link_bucket : Adding element [%s]  to bin [%s] failed\n",\
                GST_ELEMENT_NAME(GST_ELEMENT(x_bin[x_id].gst)),\
-               GST_ELEMENT_NAME(GST_ELEMENT(y_bin) ) );\
+               GST_ELEMENT_NAME(GST_ELEMENT(y_bin)));\
        goto ERROR;\
 }\
 
@@ -4734,7 +4734,7 @@ do \
 { \
        x_bin[x_id].id = x_id;\
        x_bin[x_id].gst = gst_element_factory_make(x_factory, x_name);\
-       if ( ! x_bin[x_id].gst )\
+       if (!x_bin[x_id].gst)\
        {\
                LOGE("failed to create %s \n", x_factory);\
                goto ERROR;\
@@ -4744,9 +4744,9 @@ do \
                if (x_player->ini.set_dump_element_flag)\
                        __mmplayer_add_dump_buffer_probe(x_player, x_bin[x_id].gst);\
        }\
-       if ( x_add_bucket )\
+       if (x_add_bucket)\
                element_bucket = g_list_append(element_bucket, &x_bin[x_id]);\
-} while(0);
+} while (0);
 
 static void
 __mmplayer_audio_stream_clear_buffer(mm_player_t* player, gboolean send_all)
@@ -4792,7 +4792,7 @@ __mmplayer_audio_stream_send_data(mm_player_t* player, mm_player_audio_stream_bu
        audio_stream.data_size = a_buffer->data_size;
        audio_stream.data = a_buffer->pcm_data;
 
-       LOGD ("[%lld] send data size:%d, %p", audio_stream.channel_mask, audio_stream.data_size, player->audio_stream_cb_user_param);
+       LOGD("[%lld] send data size:%d, %p", audio_stream.channel_mask, audio_stream.data_size, player->audio_stream_cb_user_param);
        player->audio_stream_render_cb_ex(&audio_stream, player->audio_stream_cb_user_param);
 
        MMPLAYER_FLEAVE();
@@ -4821,15 +4821,15 @@ __mmplayer_audio_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
        a_data = mapinfo.data;
        a_size = mapinfo.size;
 
-       GstCaps *caps = gst_pad_get_current_caps( pad );
-       GstStructure *structure = gst_caps_get_structure (caps, 0);
+       GstCaps *caps = gst_pad_get_current_caps(pad);
+       GstStructure *structure = gst_caps_get_structure(caps, 0);
 
        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
-       gst_structure_get_int (structure, "rate", &rate);
-       gst_structure_get_int (structure, "channels", &channel);
-       gst_structure_get_int (structure, "depth", &depth);
-       gst_structure_get_int (structure, "endianness", &endianness);
-       gst_structure_get (structure, "channel-mask", GST_TYPE_BITMASK, &channel_mask, NULL);
+       gst_structure_get_int(structure, "rate", &rate);
+       gst_structure_get_int(structure, "channels", &channel);
+       gst_structure_get_int(structure, "depth", &depth);
+       gst_structure_get_int(structure, "endianness", &endianness);
+       gst_structure_get(structure, "channel-mask", GST_TYPE_BITMASK, &channel_mask, NULL);
        gst_caps_unref(GST_CAPS(caps));
 
        /* In case of the sync is false, use buffer list.              *
@@ -4894,7 +4894,7 @@ __mmplayer_audio_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
                }
                memcpy(a_buffer->pcm_data, a_data, a_size);
                LOGD("new [%lld] total:%d buff:%d", channel_mask, a_buffer->data_size, a_buffer->buff_size);
-               player->audio_stream_buff_list = g_list_append (player->audio_stream_buff_list, a_buffer);
+               player->audio_stream_buff_list = g_list_append(player->audio_stream_buff_list, a_buffer);
        } else {
                /* If sync is TRUE, send data directly. */
                a_buffer->pcm_data = a_data;
@@ -4908,7 +4908,7 @@ DONE:
 }
 
 static void
-__mmplayer_gst_audio_deinterleave_pad_added (GstElement *elem, GstPad *pad, gpointer data)
+__mmplayer_gst_audio_deinterleave_pad_added(GstElement *elem, GstPad *pad, gpointer data)
 {
        mm_player_t* player = (mm_player_t*)data;
        MMPlayerGstElement* audiobin = player->pipeline->audiobin;
@@ -4916,53 +4916,53 @@ __mmplayer_gst_audio_deinterleave_pad_added (GstElement *elem, GstPad *pad, gpoi
        GstElement *queue = NULL, *sink = NULL;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL (player && player->pipeline && player->pipeline->mainbin);
+       MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
 
-       queue = gst_element_factory_make ("queue", NULL);
+       queue = gst_element_factory_make("queue", NULL);
        if (queue == NULL)
        {
-               LOGD ("fail make queue\n");
+               LOGD("fail make queue\n");
                goto ERROR;
        }
 
-       sink = gst_element_factory_make ("fakesink", NULL);
+       sink = gst_element_factory_make("fakesink", NULL);
        if (sink == NULL)
        {
-               LOGD ("fail make fakesink\n");
+               LOGD("fail make fakesink\n");
                goto ERROR;
        }
 
-       gst_bin_add_many (GST_BIN(audiobin[MMPLAYER_A_BIN].gst), queue, sink, NULL);
+       gst_bin_add_many(GST_BIN(audiobin[MMPLAYER_A_BIN].gst), queue, sink, NULL);
 
-       if (!gst_element_link_pads_full (queue, "src", sink, "sink", GST_PAD_LINK_CHECK_NOTHING))
+       if (!gst_element_link_pads_full(queue, "src", sink, "sink", GST_PAD_LINK_CHECK_NOTHING))
        {
                LOGW("failed to link queue & sink\n");
                goto ERROR;
        }
 
-       sinkpad = gst_element_get_static_pad (queue, "sink");
+       sinkpad = gst_element_get_static_pad(queue, "sink");
 
        if (GST_PAD_LINK_OK != gst_pad_link(pad, sinkpad))
        {
-               LOGW ("failed to link [%s:%s] to queue\n", GST_DEBUG_PAD_NAME(pad));
+               LOGW("failed to link [%s:%s] to queue\n", GST_DEBUG_PAD_NAME(pad));
                goto ERROR;
        }
 
        LOGE("player->audio_stream_sink_sync: %d\n", player->audio_stream_sink_sync);
 
-       gst_object_unref (sinkpad);
-       g_object_set (sink, "sync", player->audio_stream_sink_sync, NULL);
-       g_object_set (sink, "signal-handoffs", TRUE, NULL);
+       gst_object_unref(sinkpad);
+       g_object_set(sink, "sync", player->audio_stream_sink_sync, NULL);
+       g_object_set(sink, "signal-handoffs", TRUE, NULL);
 
-       gst_element_set_state (sink, GST_STATE_PAUSED);
-       gst_element_set_state (queue, GST_STATE_PAUSED);
+       gst_element_set_state(sink, GST_STATE_PAUSED);
+       gst_element_set_state(queue, GST_STATE_PAUSED);
 
-       MMPLAYER_SIGNAL_CONNECT( player,
+       MMPLAYER_SIGNAL_CONNECT(player,
                G_OBJECT(sink),
                MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
                "handoff",
                G_CALLBACK(__mmplayer_audio_stream_decoded_render_cb),
-               (gpointer)player );
+               (gpointer)player);
 
        MMPLAYER_FLEAVE();
        return ;
@@ -4981,7 +4981,7 @@ ERROR:
        }
        if (sinkpad)
        {
-               gst_object_unref ( GST_OBJECT(sinkpad) );
+               gst_object_unref(GST_OBJECT(sinkpad));
                sinkpad = NULL;
        }
 
@@ -5004,7 +5004,7 @@ void __mmplayer_gst_set_audiosink_property(mm_player_t* player, MMHandleType att
         */
        MMPLAYER_FENTER();
        mm_attrs_get_int_by_name(attrs, "sound_stream_index", &stream_id);
-       mm_attrs_get_string_by_name (attrs, "sound_stream_type", &stream_type );
+       mm_attrs_get_string_by_name(attrs, "sound_stream_type", &stream_type);
 
        if (!stream_type)
        {
@@ -5074,11 +5074,11 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* alloc handles */
        audiobin = (MMPlayerGstElement*)g_malloc0(sizeof(MMPlayerGstElement) * MMPLAYER_A_NUM);
-       if ( ! audiobin )
+       if (!audiobin)
        {
                LOGE("failed to allocate memory for audiobin\n");
                return MM_ERROR_PLAYER_NO_FREE_SPACE;
@@ -5089,7 +5089,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
        /* create bin */
        audiobin[MMPLAYER_A_BIN].id = MMPLAYER_A_BIN;
        audiobin[MMPLAYER_A_BIN].gst = gst_bin_new("audiobin");
-       if ( !audiobin[MMPLAYER_A_BIN].gst )
+       if (!audiobin[MMPLAYER_A_BIN].gst)
        {
                LOGE("failed to create audiobin\n");
                goto ERROR;
@@ -5111,7 +5111,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
        if (player->set_mode.pcm_extraction) // pcm extraction only and no sound output
        {
-               if(player->audio_stream_render_cb_ex)
+               if (player->audio_stream_render_cb_ex)
                {
                        char *caps_str = NULL;
                        GstCaps* caps = NULL;
@@ -5120,11 +5120,11 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                        /* capsfilter */
                        MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audio capsfilter", TRUE, player);
 
-                       mm_attrs_get_string_by_name (player->attrs, "pcm_audioformat", &format );
+                       mm_attrs_get_string_by_name(player->attrs, "pcm_audioformat", &format);
 
                        LOGD("contents : format: %s samplerate : %d pcm_channel: %d", format, player->pcm_samplerate, player->pcm_channel);
 
-                       caps = gst_caps_new_simple ("audio/x-raw",
+                       caps = gst_caps_new_simple("audio/x-raw",
                                        "format", G_TYPE_STRING, format,
                                        "rate", G_TYPE_INT, player->pcm_samplerate,
                                        "channels", G_TYPE_INT, player->pcm_channel,
@@ -5132,17 +5132,17 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                        caps_str = gst_caps_to_string(caps);
                        LOGD("new caps : %s\n", caps_str);
 
-                       g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
+                       g_object_set(GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL);
 
                        /* clean */
-                       gst_caps_unref( caps );
-                       MMPLAYER_FREEIF( caps_str );
+                       gst_caps_unref(caps);
+                       MMPLAYER_FREEIF(caps_str);
 
                        MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_DEINTERLEAVE, "deinterleave", "deinterleave", TRUE, player);
 
-                       g_object_set (G_OBJECT (audiobin[MMPLAYER_A_DEINTERLEAVE].gst), "keep-positions", TRUE, NULL);
+                       g_object_set(G_OBJECT(audiobin[MMPLAYER_A_DEINTERLEAVE].gst), "keep-positions", TRUE, NULL);
                        /* raw pad handling signal */
-                       MMPLAYER_SIGNAL_CONNECT( player,
+                       MMPLAYER_SIGNAL_CONNECT(player,
                                (audiobin[MMPLAYER_A_DEINTERLEAVE].gst),
                                MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
                                                                                                G_CALLBACK(__mmplayer_gst_audio_deinterleave_pad_added), player);
@@ -5165,7 +5165,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
                        /* capsfilter */
                        MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audio capsfilter", TRUE, player);
-                       caps = gst_caps_new_simple ("audio/x-raw",
+                       caps = gst_caps_new_simple("audio/x-raw",
                                        "rate", G_TYPE_INT, dst_samplerate,
                                        "channels", G_TYPE_INT, dst_channels,
                                        "depth", G_TYPE_INT, dst_depth,
@@ -5173,17 +5173,17 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                        caps_str = gst_caps_to_string(caps);
                        LOGD("new caps : %s\n", caps_str);
 
-                       g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
+                       g_object_set(GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL);
 
                        /* clean */
-                       gst_caps_unref( caps );
-                       MMPLAYER_FREEIF( caps_str );
+                       gst_caps_unref(caps);
+                       MMPLAYER_FREEIF(caps_str);
 
                        /* fake sink */
                        MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_SINK, "fakesink", "fakesink", TRUE, player);
 
                        /* set sync */
-                       g_object_set (G_OBJECT (audiobin[MMPLAYER_A_SINK].gst), "sync", FALSE, NULL);
+                       g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "sync", FALSE, NULL);
                }
        }
        else // normal playback
@@ -5193,24 +5193,24 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
                /* for logical volume control */
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_VOL, "volume", "volume", TRUE, player);
-               g_object_set(G_OBJECT (audiobin[MMPLAYER_A_VOL].gst), "volume", player->sound.volume, NULL);
+               g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "volume", player->sound.volume, NULL);
 
                if (player->sound.mute)
                {
                        LOGD("mute enabled\n");
-                       g_object_set(G_OBJECT (audiobin[MMPLAYER_A_VOL].gst), "mute", player->sound.mute, NULL);
+                       g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "mute", player->sound.mute, NULL);
                }
 
 #if 0
                /*capsfilter */
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CAPS_DEFAULT, "capsfilter", "audiocapsfilter", TRUE, player);
-               caps = gst_caps_from_string( "audio/x-raw-int, "
+               caps = gst_caps_from_string("audio/x-raw-int, "
                                        "endianness = (int) LITTLE_ENDIAN, "
                                        "signed = (boolean) true, "
                                        "width = (int) 16, "
-                                       "depth = (int) 16" );
-               g_object_set (GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL );
-               gst_caps_unref( caps );
+                                       "depth = (int) 16");
+               g_object_set(GST_ELEMENT(audiobin[MMPLAYER_A_CAPS_DEFAULT].gst), "caps", caps, NULL);
+               gst_caps_unref(caps);
 #endif
 
                /* chech if multi-chennels */
@@ -5226,7 +5226,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                                        //MMPLAYER_LOG_GST_CAPS_TYPE(caps);
                                        GstStructure *str = gst_caps_get_structure(caps, 0);
                                        if (str)
-                                               gst_structure_get_int (str, "channels", &channels);
+                                               gst_structure_get_int(str, "channels", &channels);
                                        gst_caps_unref(caps);
                                }
                                gst_object_unref(srcpad);
@@ -5234,7 +5234,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                }
 
                /* audio effect element. if audio effect is enabled */
-               if ( (strcmp(player->ini.audioeffect_element, ""))
+               if ((strcmp(player->ini.audioeffect_element, ""))
                        && (channels <= 2)
                        && (player->ini.use_audio_effect_preset || player->ini.use_audio_effect_custom))
                {
@@ -5242,10 +5242,10 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
                        LOGD("audio effect config. bypass = %d, effect type  = %d", player->bypass_audio_effect, player->audio_effect_info.effect_type);
 
-                       if ( (!player->bypass_audio_effect)
-                               && (player->ini.use_audio_effect_preset || player->ini.use_audio_effect_custom) )
+                       if ((!player->bypass_audio_effect)
+                               && (player->ini.use_audio_effect_preset || player->ini.use_audio_effect_custom))
                        {
-                               if ( MM_AUDIO_EFFECT_TYPE_CUSTOM == player->audio_effect_info.effect_type )
+                               if (MM_AUDIO_EFFECT_TYPE_CUSTOM == player->audio_effect_info.effect_type)
                                {
                                        if (!_mmplayer_audio_effect_custom_apply(player))
                                        {
@@ -5254,8 +5254,8 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                                }
                        }
 
-                       if ( (strcmp(player->ini.audioeffect_element_custom, ""))
-                               && (player->set_mode.rich_audio) )
+                       if ((strcmp(player->ini.audioeffect_element_custom, ""))
+                               && (player->set_mode.rich_audio))
                        {
                                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_FILTER_SEC, player->ini.audioeffect_element_custom, "audio effect filter custom", TRUE, player);
                        }
@@ -5270,13 +5270,13 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
                MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_SINK, player->ini.audiosink_element, "audiosink", link_audio_sink_now, player);
 
                /* qos on */
-               g_object_set (G_OBJECT (audiobin[MMPLAYER_A_SINK].gst), "qos", TRUE, NULL);     /* qos on */
-               g_object_set (G_OBJECT (audiobin[MMPLAYER_A_SINK].gst), "slave-method", GST_AUDIO_BASE_SINK_SLAVE_NONE, NULL);
+               g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "qos", TRUE, NULL);       /* qos on */
+               g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "slave-method", GST_AUDIO_BASE_SINK_SLAVE_NONE, NULL);
 
                if (player->videodec_linked && player->ini.use_system_clock)
                {
                        LOGD("system clock will be used.\n");
-                       g_object_set (G_OBJECT (audiobin[MMPLAYER_A_SINK].gst), "provide-clock", FALSE,  NULL);
+                       g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "provide-clock", FALSE,  NULL);
                }
 
                if (g_strrstr(player->ini.audiosink_element, "pulsesink"))
@@ -5287,16 +5287,16 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
        {
                GstPad *sink_pad = NULL;
                sink_pad = gst_element_get_static_pad(audiobin[MMPLAYER_A_SINK].gst, "sink");
-               MMPLAYER_SIGNAL_CONNECT (player, sink_pad, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
+               MMPLAYER_SIGNAL_CONNECT(player, sink_pad, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN,
                                        "notify::caps", G_CALLBACK(__mmplayer_gst_caps_notify_cb), player);
-               gst_object_unref (GST_OBJECT(sink_pad));
+               gst_object_unref(GST_OBJECT(sink_pad));
        }
 
-       __mmplayer_add_sink( player, audiobin[MMPLAYER_A_SINK].gst );
+       __mmplayer_add_sink(player, audiobin[MMPLAYER_A_SINK].gst);
 
        /* adding created elements to bin */
        LOGD("adding created elements to bin\n");
-       if( !__mmplayer_gst_element_add_bucket_to_bin( GST_BIN(audiobin[MMPLAYER_A_BIN].gst), element_bucket ))
+       if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(audiobin[MMPLAYER_A_BIN].gst), element_bucket))
        {
                LOGE("failed to add elements\n");
                goto ERROR;
@@ -5304,7 +5304,7 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
 
        /* linking elements in the bucket by added order. */
        LOGD("Linking elements in the bucket by added order.\n");
-       if ( __mmplayer_gst_element_link_bucket(element_bucket) == -1 )
+       if (__mmplayer_gst_element_link_bucket(element_bucket) == -1)
        {
                LOGE("failed to link elements\n");
                goto ERROR;
@@ -5319,20 +5319,20 @@ __mmplayer_gst_create_audio_pipeline(mm_player_t* player)
        }
 
        pad = gst_element_get_static_pad(GST_ELEMENT(first_element->gst), "sink");
-       if ( ! pad )
+       if (!pad)
        {
                LOGE("failed to get pad from first element of audiobin\n");
                goto ERROR;
        }
 
        ghostpad = gst_ghost_pad_new("sink", pad);
-       if ( ! ghostpad )
+       if (!ghostpad)
        {
                LOGE("failed to create ghostpad\n");
                goto ERROR;
        }
 
-       if ( FALSE == gst_element_add_pad(audiobin[MMPLAYER_A_BIN].gst, ghostpad) )
+       if (FALSE == gst_element_add_pad(audiobin[MMPLAYER_A_BIN].gst, ghostpad))
        {
                LOGE("failed to add ghostpad to audiobin\n");
                goto ERROR;
@@ -5352,24 +5352,24 @@ ERROR:
 
        LOGD("ERROR : releasing audiobin\n");
 
-       if ( pad )
+       if (pad)
                gst_object_unref(GST_OBJECT(pad));
 
-       if ( ghostpad )
+       if (ghostpad)
                gst_object_unref(GST_OBJECT(ghostpad));
 
        if (element_bucket)
-               g_list_free( element_bucket );
+               g_list_free(element_bucket);
 
        /* release element which are not added to bin */
-       for ( i = 1; i < MMPLAYER_A_NUM; i++ )  /* NOTE : skip bin */
+       for (i = 1; i < MMPLAYER_A_NUM; i++)    /* NOTE : skip bin */
        {
-               if ( audiobin[i].gst )
+               if (audiobin[i].gst)
                {
                        GstObject* parent = NULL;
-                       parent = gst_element_get_parent( audiobin[i].gst );
+                       parent = gst_element_get_parent(audiobin[i].gst);
 
-                       if ( !parent )
+                       if (!parent)
                        {
                                gst_object_unref(GST_OBJECT(audiobin[i].gst));
                                audiobin[i].gst = NULL;
@@ -5382,12 +5382,12 @@ ERROR:
        }
 
        /* release audiobin with it's childs */
-       if ( audiobin[MMPLAYER_A_BIN].gst )
+       if (audiobin[MMPLAYER_A_BIN].gst)
        {
                gst_object_unref(GST_OBJECT(audiobin[MMPLAYER_A_BIN].gst));
        }
 
-       MMPLAYER_FREEIF( audiobin );
+       MMPLAYER_FREEIF(audiobin);
 
        player->pipeline->audiobin = NULL;
 
@@ -5395,7 +5395,7 @@ ERROR:
 }
 
 static GstPadProbeReturn
-__mmplayer_audio_stream_probe (GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
+__mmplayer_audio_stream_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
 {
        mm_player_t* player = (mm_player_t*) u_data;
        GstBuffer *pad_buffer = gst_pad_probe_info_get_buffer(info);
@@ -5499,7 +5499,7 @@ __mmplayer_video_stream_get_bo(mm_player_t* player, int size)
                if (player->video_bo_list) {
                        /* if bo list did not created all, try it again. */
                        idx = g_list_length(player->video_bo_list);
-                       LOGD("bo list exist (len: %d)", idx);
+                       LOGD("bo list exist(len: %d)", idx);
                }
 
                for (; idx<player->ini.num_of_video_bo ; idx++) {
@@ -5595,7 +5595,7 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
 
        caps = gst_pad_get_current_caps(pad);
        if (caps == NULL) {
-               LOGE( "Caps is NULL." );
+               LOGE("Caps is NULL.");
                return;
        }
 
@@ -5604,20 +5604,20 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
        /* clear stream data structure */
        memset(&stream, 0x0, sizeof(MMPlayerVideoStreamDataType));
 
-       structure = gst_caps_get_structure( caps, 0 );
-       gst_structure_get_int(structure, "width", &(stream.width));
-       gst_structure_get_int(structure, "height", &(stream.height));
+       structure = gst_caps_get_structure(caps, 0);
+       gst_structure_get_int(structure, "width", & (stream.width));
+       gst_structure_get_int(structure, "height", & (stream.height));
        string_format = gst_structure_get_string(structure, "format");
-       if(string_format) {
+       if (string_format) {
                fourcc = _mmplayer_convert_fourcc_string_to_value(string_format);
        }
        stream.format = util_get_pixtype(fourcc);
-       gst_caps_unref( caps );
+       gst_caps_unref(caps);
        caps = NULL;
 
     /*
-       LOGD( "Call video steramCb, data[%p], Width[%d],Height[%d], Format[%d]",
-                       GST_BUFFER_DATA(buffer), stream.width, stream.height, stream.format );
+       LOGD("Call video steramCb, data[%p], Width[%d],Height[%d], Format[%d]",
+                       GST_BUFFER_DATA(buffer), stream.width, stream.height, stream.format);
     */
 
        if (stream.width == 0 || stream.height == 0 || stream.format == MM_PIXEL_FORMAT_INVALID) {
@@ -5658,7 +5658,7 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
                stream.internal_buffer = buffer;
        } else { /* sw codec */
                tbm_bo_handle thandle;
-               int stride = GST_ROUND_UP_4 (stream.width);
+               int stride = GST_ROUND_UP_4(stream.width);
                int elevation = stream.height;
                int size = 0;
 
@@ -5672,7 +5672,7 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
                stream.stride[0] = stride;
                stream.elevation[0] = elevation;
                if (stream.format == MM_PIXEL_FORMAT_I420) {
-                       stream.stride[1] = stream.stride[2] = GST_ROUND_UP_4 (GST_ROUND_UP_2 (stream.width) / 2);
+                       stream.stride[1] = stream.stride[2] = GST_ROUND_UP_4(GST_ROUND_UP_2(stream.width) / 2);
                        stream.elevation[1] = stream.elevation[2] = elevation / 2;
                } else {
                        LOGE("Not support format %d", stream.format);
@@ -5682,13 +5682,13 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
 
                size = (stream.stride[0] + stream.stride[1]) * elevation;
                stream.bo[0] = __mmplayer_video_stream_get_bo(player, size);
-               if(!stream.bo[0]) {
+               if (!stream.bo[0]) {
                        LOGE("Fail to tbm_bo_alloc!!");
                        gst_memory_unmap(dataBlock, &mapinfo);
                        return;
                }
                thandle = tbm_bo_map(stream.bo[0], TBM_DEVICE_CPU, TBM_OPTION_WRITE);
-               if(thandle.ptr && mapinfo.data)
+               if (thandle.ptr && mapinfo.data)
                        memcpy(thandle.ptr, mapinfo.data, size);
                else
                        LOGE("data pointer is wrong. dest : %p, src : %p",
@@ -5720,11 +5720,11 @@ __mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket)
 
        MMPLAYER_FENTER();
 
-       mm_attrs_get_int_by_name (player->attrs, "display_surface_type", (int *)&surface_type);
+       mm_attrs_get_int_by_name(player->attrs, "display_surface_type", (int *)&surface_type);
 
        if (player->set_mode.video_zc) /* ST12 or SN12 , if player use omx, evasimagesink doesn't use videoconvert */
        {
-               if ( (surface_type == MM_DISPLAY_SURFACE_EVAS) && ( !strcmp(player->ini.videosink_element_evas, "evasimagesink")) )
+               if ((surface_type == MM_DISPLAY_SURFACE_EVAS) && (!strcmp(player->ini.videosink_element_evas, "evasimagesink")))
                {
                        video_csc = player->ini.videoconverter_element;
                }
@@ -5747,7 +5747,7 @@ __mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket)
        }
 
        /* set video rotator */
-       if ( !player->set_mode.video_zc )
+       if (!player->set_mode.video_zc)
                MMPLAYER_CREATE_ELEMENT(player->pipeline->videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE, player);
 
        /* videoscaler */
@@ -5778,10 +5778,10 @@ ERROR:
  */
 /**
   * VIDEO PIPELINE
-  * - video overlay surface (arm/x86) : waylandsink
-  * - evas surface  (arm) : evaspixmapsink
-  *                         fimcconvert ! evasimagesink
-  * - evas surface  (x86) : videoconvertor ! videoflip ! evasimagesink
+  * - video overlay surface(arm/x86) : waylandsink
+  * - evas surface (arm) : evaspixmapsink
+  *                         fimcconvert !evasimagesink
+  * - evas surface (x86) : videoconvertor !videoflip !evasimagesink
   */
 static int
 __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDisplaySurfaceType surface_type)
@@ -5799,7 +5799,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
 
        /* alloc handles */
        videobin = (MMPlayerGstElement*)g_malloc0(sizeof(MMPlayerGstElement) * MMPLAYER_V_NUM);
-       if ( !videobin )
+       if (!videobin)
        {
                return MM_ERROR_PLAYER_NO_FREE_SPACE;
        }
@@ -5807,7 +5807,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        player->pipeline->videobin = videobin;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -5816,7 +5816,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        /* create bin */
        videobin[MMPLAYER_V_BIN].id = MMPLAYER_V_BIN;
        videobin[MMPLAYER_V_BIN].gst = gst_bin_new("videobin");
-       if ( !videobin[MMPLAYER_V_BIN].gst )
+       if (!videobin[MMPLAYER_V_BIN].gst)
        {
                LOGE("failed to create videobin");
                goto ERROR;
@@ -5872,7 +5872,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                                LOGD("selected videosink name: %s", videosink_element);
 
                                /* support shard memory with S/W codec on HawkP */
-                               if(strncmp(videosink_element, "waylandsink", strlen(videosink_element)) == 0)
+                               if (strncmp(videosink_element, "waylandsink", strlen(videosink_element)) == 0)
                                {
                                        g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst,
                                                "use-tbm", use_tbm, NULL);
@@ -5884,7 +5884,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                                {
                                        int gapless = 0;
 
-                                       mm_attrs_get_int_by_name (attrs, "gapless_mode", &gapless);
+                                       mm_attrs_get_int_by_name(attrs, "gapless_mode", &gapless);
 
                                        if (gapless > 0) {
                                                LOGD("disable last-sample");
@@ -5930,9 +5930,9 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                sink_pad = gst_element_get_static_pad(videobin[MMPLAYER_V_SINK].gst, "sink");
                if (sink_pad)
                {
-                       MMPLAYER_SIGNAL_CONNECT (player, sink_pad, MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
+                       MMPLAYER_SIGNAL_CONNECT(player, sink_pad, MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
                                        "notify::caps", G_CALLBACK(__mmplayer_gst_caps_notify_cb), player);
-                       gst_object_unref (GST_OBJECT(sink_pad));
+                       gst_object_unref(GST_OBJECT(sink_pad));
                }
                else
                {
@@ -5941,17 +5941,17 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        }
 
        /* store it as it's sink element */
-       __mmplayer_add_sink( player, videobin[MMPLAYER_V_SINK].gst );
+       __mmplayer_add_sink(player, videobin[MMPLAYER_V_SINK].gst);
 
        /* adding created elements to bin */
-       if( ! __mmplayer_gst_element_add_bucket_to_bin(GST_BIN(videobin[MMPLAYER_V_BIN].gst), element_bucket) )
+       if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(videobin[MMPLAYER_V_BIN].gst), element_bucket))
        {
                LOGE("failed to add elements\n");
                goto ERROR;
        }
 
        /* Linking elements in the bucket by added order */
-       if ( __mmplayer_gst_element_link_bucket(element_bucket) == -1 )
+       if (__mmplayer_gst_element_link_bucket(element_bucket) == -1)
        {
                LOGE("failed to link elements\n");
                goto ERROR;
@@ -5960,14 +5960,14 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
        /* get first element's sinkpad for creating ghostpad */
        if (element_bucket)
                first_element = (MMPlayerGstElement *)element_bucket->data;
-       if ( !first_element )
+       if (!first_element)
        {
                LOGE("failed to get first element from bucket\n");
                goto ERROR;
        }
 
        pad = gst_element_get_static_pad(GST_ELEMENT(first_element->gst), "sink");
-       if ( !pad )
+       if (!pad)
        {
                LOGE("failed to get pad from first element\n");
                goto ERROR;
@@ -5975,7 +5975,7 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
 
        /* create ghostpad */
        player->ghost_pad_for_videobin = gst_ghost_pad_new("sink", pad);
-       if ( FALSE == gst_element_add_pad(videobin[MMPLAYER_V_BIN].gst, player->ghost_pad_for_videobin) )
+       if (FALSE == gst_element_add_pad(videobin[MMPLAYER_V_BIN].gst, player->ghost_pad_for_videobin))
        {
                LOGE("failed to add ghostpad to videobin\n");
                goto ERROR;
@@ -5995,19 +5995,19 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
 ERROR:
        LOGE("ERROR : releasing videobin\n");
 
-       g_list_free( element_bucket );
+       g_list_free(element_bucket);
 
        if (pad)
                gst_object_unref(GST_OBJECT(pad));
 
        /* release videobin with it's childs */
-       if ( videobin[MMPLAYER_V_BIN].gst )
+       if (videobin[MMPLAYER_V_BIN].gst)
        {
                gst_object_unref(GST_OBJECT(videobin[MMPLAYER_V_BIN].gst));
        }
 
 
-       MMPLAYER_FREEIF( videobin );
+       MMPLAYER_FREEIF(videobin);
 
        player->pipeline->videobin = NULL;
 
@@ -6021,43 +6021,43 @@ static int __mmplayer_gst_create_plain_text_elements(mm_player_t* player)
 
        MMPLAYER_CREATE_ELEMENT(textbin, MMPLAYER_T_QUEUE, "queue", "text_queue", TRUE, player);
        MMPLAYER_CREATE_ELEMENT(textbin, MMPLAYER_T_IDENTITY, "identity", "text_identity", TRUE, player);
-       g_object_set (G_OBJECT (textbin[MMPLAYER_T_IDENTITY].gst),
+       g_object_set(G_OBJECT(textbin[MMPLAYER_T_IDENTITY].gst),
                                                        "signal-handoffs", FALSE,
                                                        NULL);
 
        MMPLAYER_CREATE_ELEMENT(textbin, MMPLAYER_T_FAKE_SINK, "fakesink", "text_fakesink", TRUE, player);
-       MMPLAYER_SIGNAL_CONNECT( player,
+       MMPLAYER_SIGNAL_CONNECT(player,
                                                        G_OBJECT(textbin[MMPLAYER_T_FAKE_SINK].gst),
                                                        MM_PLAYER_SIGNAL_TYPE_TEXTBIN,
                                                        "handoff",
                                                        G_CALLBACK(__mmplayer_update_subtitle),
-                                                       (gpointer)player );
+                                                       (gpointer)player);
 
-       g_object_set (G_OBJECT (textbin[MMPLAYER_T_FAKE_SINK].gst), "async", TRUE, NULL);
-       g_object_set (G_OBJECT (textbin[MMPLAYER_T_FAKE_SINK].gst), "sync", TRUE, NULL);
-       g_object_set (G_OBJECT (textbin[MMPLAYER_T_FAKE_SINK].gst), "signal-handoffs", TRUE, NULL);
+       g_object_set(G_OBJECT(textbin[MMPLAYER_T_FAKE_SINK].gst), "async", TRUE, NULL);
+       g_object_set(G_OBJECT(textbin[MMPLAYER_T_FAKE_SINK].gst), "sync", TRUE, NULL);
+       g_object_set(G_OBJECT(textbin[MMPLAYER_T_FAKE_SINK].gst), "signal-handoffs", TRUE, NULL);
 
        if (!player->play_subtitle)
        {
-               LOGD ("add textbin sink as sink element of whole pipeline.\n");
-               __mmplayer_add_sink (player, GST_ELEMENT(textbin[MMPLAYER_T_FAKE_SINK].gst));
+               LOGD("add textbin sink as sink element of whole pipeline.\n");
+               __mmplayer_add_sink(player, GST_ELEMENT(textbin[MMPLAYER_T_FAKE_SINK].gst));
        }
 
        /* adding created elements to bin */
        LOGD("adding created elements to bin\n");
-       if( !__mmplayer_gst_element_add_bucket_to_bin( GST_BIN(textbin[MMPLAYER_T_BIN].gst), element_bucket ))
+       if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(textbin[MMPLAYER_T_BIN].gst), element_bucket))
        {
                LOGE("failed to add elements\n");
                goto ERROR;
        }
 
        /* unset sink flag from textbin. not to hold eos when video data is shorter than subtitle */
-       GST_OBJECT_FLAG_UNSET (textbin[MMPLAYER_T_BIN].gst, GST_ELEMENT_FLAG_SINK);
-       GST_OBJECT_FLAG_UNSET (textbin[MMPLAYER_T_FAKE_SINK].gst, GST_ELEMENT_FLAG_SINK);
+       GST_OBJECT_FLAG_UNSET(textbin[MMPLAYER_T_BIN].gst, GST_ELEMENT_FLAG_SINK);
+       GST_OBJECT_FLAG_UNSET(textbin[MMPLAYER_T_FAKE_SINK].gst, GST_ELEMENT_FLAG_SINK);
 
        /* linking elements in the bucket by added order. */
        LOGD("Linking elements in the bucket by added order.\n");
-       if ( __mmplayer_gst_element_link_bucket(element_bucket) == -1 )
+       if (__mmplayer_gst_element_link_bucket(element_bucket) == -1)
        {
                LOGE("failed to link elements\n");
                goto ERROR;
@@ -6110,11 +6110,11 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* alloc handles */
        textbin = (MMPlayerGstElement*)g_malloc0(sizeof(MMPlayerGstElement) * MMPLAYER_T_NUM);
-       if ( ! textbin )
+       if (!textbin)
        {
                LOGE("failed to allocate memory for textbin\n");
                return MM_ERROR_PLAYER_NO_FREE_SPACE;
@@ -6123,7 +6123,7 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
        /* create bin */
        textbin[MMPLAYER_T_BIN].id = MMPLAYER_T_BIN;
        textbin[MMPLAYER_T_BIN].gst = gst_bin_new("textbin");
-       if ( !textbin[MMPLAYER_T_BIN].gst )
+       if (!textbin[MMPLAYER_T_BIN].gst)
        {
                LOGE("failed to create textbin\n");
                goto ERROR;
@@ -6135,7 +6135,7 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
        /* fakesink */
        if (player->use_textoverlay)
        {
-               LOGD ("use textoverlay for displaying \n");
+               LOGD("use textoverlay for displaying \n");
 
                MMPLAYER_CREATE_ELEMENT_ADD_BIN(textbin, MMPLAYER_T_QUEUE, "queue", "text_t_queue", textbin[MMPLAYER_T_BIN].gst, player);
 
@@ -6145,19 +6145,19 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
 
                MMPLAYER_CREATE_ELEMENT_ADD_BIN(textbin, MMPLAYER_T_OVERLAY, "textoverlay", "text_overlay", textbin[MMPLAYER_T_BIN].gst, player);
 
-               if (!gst_element_link_pads (textbin[MMPLAYER_T_VIDEO_QUEUE].gst, "src", textbin[MMPLAYER_T_VIDEO_CONVERTER].gst, "sink"))
+               if (!gst_element_link_pads(textbin[MMPLAYER_T_VIDEO_QUEUE].gst, "src", textbin[MMPLAYER_T_VIDEO_CONVERTER].gst, "sink"))
                {
                        LOGE("failed to link queue and converter\n");
                        goto ERROR;
                }
 
-               if (!gst_element_link_pads (textbin[MMPLAYER_T_VIDEO_CONVERTER].gst, "src", textbin[MMPLAYER_T_OVERLAY].gst, "video_sink"))
+               if (!gst_element_link_pads(textbin[MMPLAYER_T_VIDEO_CONVERTER].gst, "src", textbin[MMPLAYER_T_OVERLAY].gst, "video_sink"))
                {
                        LOGE("failed to link queue and textoverlay\n");
                        goto ERROR;
                }
 
-               if (!gst_element_link_pads (textbin[MMPLAYER_T_QUEUE].gst, "src", textbin[MMPLAYER_T_OVERLAY].gst, "text_sink"))
+               if (!gst_element_link_pads(textbin[MMPLAYER_T_QUEUE].gst, "src", textbin[MMPLAYER_T_OVERLAY].gst, "text_sink"))
                {
                        LOGE("failed to link queue and textoverlay\n");
                        goto ERROR;
@@ -6167,11 +6167,11 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
        {
                int surface_type = 0;
 
-               LOGD ("use subtitle message for displaying \n");
+               LOGD("use subtitle message for displaying \n");
 
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &surface_type);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
 
-               switch(surface_type)
+               switch (surface_type)
                {
                        case MM_DISPLAY_SURFACE_OVERLAY:
                        case MM_DISPLAY_SURFACE_EVAS:
@@ -6198,17 +6198,17 @@ ERROR:
 
        LOGD("ERROR : releasing textbin\n");
 
-       g_list_free( element_bucket );
+       g_list_free(element_bucket);
 
        /* release element which are not added to bin */
-       for ( i = 1; i < MMPLAYER_T_NUM; i++ )  /* NOTE : skip bin */
+       for (i = 1; i < MMPLAYER_T_NUM; i++)    /* NOTE : skip bin */
        {
-               if ( textbin[i].gst )
+               if (textbin[i].gst)
                {
                        GstObject* parent = NULL;
-                       parent = gst_element_get_parent( textbin[i].gst );
+                       parent = gst_element_get_parent(textbin[i].gst);
 
-                       if ( !parent )
+                       if (!parent)
                        {
                                gst_object_unref(GST_OBJECT(textbin[i].gst));
                                textbin[i].gst = NULL;
@@ -6221,12 +6221,12 @@ ERROR:
        }
 
        /* release textbin with it's childs */
-       if ( textbin[MMPLAYER_T_BIN].gst )
+       if (textbin[MMPLAYER_T_BIN].gst)
        {
                gst_object_unref(GST_OBJECT(textbin[MMPLAYER_T_BIN].gst));
        }
 
-       MMPLAYER_FREEIF( textbin );
+       MMPLAYER_FREEIF(textbin);
 
        player->pipeline->textbin = NULL;
 
@@ -6248,19 +6248,19 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* get mainbin */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        mainbin = player->pipeline->mainbin;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute\n");
                return MM_ERROR_PLAYER_INTERNAL;
        }
 
-       mm_attrs_get_string_by_name ( attrs, "subtitle_uri", &subtitle_uri );
-       if ( !subtitle_uri || strlen(subtitle_uri) < 1)
+       mm_attrs_get_string_by_name(attrs, "subtitle_uri", &subtitle_uri);
+       if (!subtitle_uri || strlen(subtitle_uri) < 1)
        {
                LOGE("subtitle uri is not proper filepath.\n");
                return MM_ERROR_PLAYER_INVALID_URI;
@@ -6270,12 +6270,12 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
 
        /* create the subtitle source */
        subsrc = gst_element_factory_make("filesrc", "subtitle_source");
-       if ( !subsrc )
+       if (!subsrc)
        {
-               LOGE ( "failed to create filesrc element\n" );
+               LOGE("failed to create filesrc element\n");
                goto ERROR;
        }
-       g_object_set(G_OBJECT (subsrc), "location", subtitle_uri, NULL);
+       g_object_set(G_OBJECT(subsrc), "location", subtitle_uri, NULL);
 
        mainbin[MMPLAYER_M_SUBSRC].id = MMPLAYER_M_SUBSRC;
        mainbin[MMPLAYER_M_SUBSRC].gst = subsrc;
@@ -6288,17 +6288,17 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
 
        /* subparse */
        subparse = gst_element_factory_make("subparse", "subtitle_parser");
-       if ( !subparse )
+       if (!subparse)
        {
-               LOGE ( "failed to create subparse element\n" );
+               LOGE("failed to create subparse element\n");
                goto ERROR;
        }
 
        charset = util_get_charset(subtitle_uri);
        if (charset)
        {
-               LOGD ("detected charset is %s\n", charset );
-               g_object_set (G_OBJECT (subparse), "subtitle-encoding", charset, NULL);
+               LOGD("detected charset is %s\n", charset);
+               g_object_set(G_OBJECT(subparse), "subtitle-encoding", charset, NULL);
        }
 
        mainbin[MMPLAYER_M_SUBPARSE].id = MMPLAYER_M_SUBPARSE;
@@ -6310,7 +6310,7 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
                goto ERROR;
        }
 
-       if (!gst_element_link_pads (subsrc, "src", subparse, "sink"))
+       if (!gst_element_link_pads(subsrc, "src", subparse, "sink"))
        {
                LOGW("failed to link subsrc and subparse\n");
                goto ERROR;
@@ -6319,7 +6319,7 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
        player->play_subtitle = TRUE;
        player->adjust_subtitle_pos = 0;
 
-       LOGD ("play subtitle using subtitle file\n");
+       LOGD("play subtitle using subtitle file\n");
 
        if (player->pipeline->textbin == NULL)
        {
@@ -6335,7 +6335,7 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
                        goto ERROR;
                }
 
-               LOGD ("link text input selector and textbin ghost pad");
+               LOGD("link text input selector and textbin ghost pad");
 
                player->textsink_linked = 1;
                player->external_text_idx = 0;
@@ -6347,13 +6347,13 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
                player->external_text_idx = 1;
        }
 
-       if (!gst_element_link_pads (subparse, "src", player->pipeline->textbin[MMPLAYER_T_BIN].gst, "text_sink"))
+       if (!gst_element_link_pads(subparse, "src", player->pipeline->textbin[MMPLAYER_T_BIN].gst, "text_sink"))
        {
                LOGW("failed to link subparse and textbin\n");
                goto ERROR;
        }
 
-       pad = gst_element_get_static_pad (player->pipeline->textbin[MMPLAYER_T_FAKE_SINK].gst, "sink");
+       pad = gst_element_get_static_pad(player->pipeline->textbin[MMPLAYER_T_FAKE_SINK].gst, "sink");
 
        if (!pad)
        {
@@ -6361,14 +6361,14 @@ __mmplayer_gst_create_subtitle_src(mm_player_t* player)
                return MM_ERROR_PLAYER_INTERNAL;
        }
 
-       gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER,
+       gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_BUFFER,
                                __mmplayer_subtitle_adjust_position_probe, player, NULL);
 
        gst_object_unref(pad);
        pad=NULL;
 
        /* create dot. for debugging */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-with-subtitle" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-with-subtitle");
        MMPLAYER_FLEAVE();
 
        return MM_ERROR_NONE;
@@ -6379,7 +6379,7 @@ ERROR:
 }
 
 gboolean
-__mmplayer_update_subtitle( GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data)
+__mmplayer_update_subtitle(GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data)
 {
        mm_player_t* player = (mm_player_t*) data;
        MMMessageParamType msg = {0, };
@@ -6391,32 +6391,32 @@ __mmplayer_update_subtitle( GstElement* object, GstBuffer *buffer, GstPad *pad,
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( buffer, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(buffer, FALSE);
 
        gst_buffer_map(buffer, &mapinfo, GST_MAP_READ);
        text = mapinfo.data;
        text_size = mapinfo.size;
        duration = GST_BUFFER_DURATION(buffer);
 
-       if ( player->set_mode.subtitle_off )
+       if (player->set_mode.subtitle_off)
        {
-               LOGD("subtitle is OFF.\n" );
+               LOGD("subtitle is OFF.\n");
                return TRUE;
        }
 
-       if ( !text || (text_size == 0))
+       if (!text || (text_size == 0))
        {
-               LOGD("There is no subtitle to be displayed.\n" );
+               LOGD("There is no subtitle to be displayed.\n");
                return TRUE;
        }
 
        msg.data = (void *) text;
        msg.subtitle.duration = GST_TIME_AS_MSECONDS(duration);
 
-       LOGD("update subtitle : [%ld msec] %s\n'", msg.subtitle.duration, (char*)msg.data );
+       LOGD("update subtitle : [%ld msec] %s\n'", msg.subtitle.duration, (char*)msg.data);
 
-       MMPLAYER_POST_MSG( player, MM_MESSAGE_UPDATE_SUBTITLE, &msg );
+       MMPLAYER_POST_MSG(player, MM_MESSAGE_UPDATE_SUBTITLE, &msg);
        gst_buffer_unmap(buffer, &mapinfo);
 
        MMPLAYER_FLEAVE();
@@ -6425,7 +6425,7 @@ __mmplayer_update_subtitle( GstElement* object, GstBuffer *buffer, GstPad *pad,
 }
 
 static GstPadProbeReturn
-__mmplayer_subtitle_adjust_position_probe (GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
+__mmplayer_subtitle_adjust_position_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
 
 {
        mm_player_t *player = (mm_player_t *) u_data;
@@ -6433,24 +6433,24 @@ __mmplayer_subtitle_adjust_position_probe (GstPad *pad, GstPadProbeInfo *info, g
        gint64 adjusted_timestamp = 0;
        GstBuffer *buffer = gst_pad_probe_info_get_buffer(info);
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
-       if ( player->set_mode.subtitle_off )
+       if (player->set_mode.subtitle_off)
        {
-               LOGD("subtitle is OFF.\n" );
+               LOGD("subtitle is OFF.\n");
                return TRUE;
        }
 
-       if (player->adjust_subtitle_pos == 0 )
+       if (player->adjust_subtitle_pos == 0)
        {
                LOGD("nothing to do");
                return TRUE;
        }
 
        cur_timestamp = GST_BUFFER_TIMESTAMP(buffer);
-       adjusted_timestamp = (gint64) cur_timestamp + ((gint64) player->adjust_subtitle_pos * G_GINT64_CONSTANT(1000000));
+       adjusted_timestamp = (gint64) cur_timestamp +((gint64) player->adjust_subtitle_pos * G_GINT64_CONSTANT(1000000));
 
-       if ( adjusted_timestamp < 0)
+       if (adjusted_timestamp < 0)
        {
                LOGD("adjusted_timestamp under zero");
                MMPLAYER_FLEAVE();
@@ -6469,12 +6469,12 @@ static int      __gst_adjust_subtitle_position(mm_player_t* player, int format, int
        MMPLAYER_FENTER();
 
        /* check player and subtitlebin are created */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player->play_subtitle, MM_ERROR_NOT_SUPPORT_API );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player->play_subtitle, MM_ERROR_NOT_SUPPORT_API);
 
        if (position == 0)
        {
-               LOGD ("nothing to do\n");
+               LOGD("nothing to do\n");
                MMPLAYER_FLEAVE();
                return MM_ERROR_NONE;
        }
@@ -6508,25 +6508,25 @@ static int __gst_adjust_video_position(mm_player_t* player, int offset)
        LOGD("adjusting video_pos in player") ;
        int current_pos = 0;
        /* check player and videobin are created */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       if ( !player->pipeline->videobin ||
-                       !player->pipeline->videobin[MMPLAYER_V_SINK].gst )
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       if (!player->pipeline->videobin ||
+                       !player->pipeline->videobin[MMPLAYER_V_SINK].gst)
        {
                LOGD("no video pipeline or sink is there");
                return MM_ERROR_PLAYER_INVALID_STATE ;
        }
        if (offset == 0)
        {
-               LOGD ("nothing to do\n");
+               LOGD("nothing to do\n");
                MMPLAYER_FLEAVE();
                return MM_ERROR_NONE;
        }
-       if(__gst_get_position ( player, MM_PLAYER_POS_FORMAT_TIME, (unsigned long*)&current_pos ) != MM_ERROR_NONE )
+       if (__gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, (unsigned long*)&current_pos) != MM_ERROR_NONE)
        {
                LOGD("failed to get current position");
                return MM_ERROR_PLAYER_INTERNAL;
        }
-       if ( (current_pos - offset ) < GST_TIME_AS_MSECONDS(player->duration) )
+       if ((current_pos - offset) < GST_TIME_AS_MSECONDS(player->duration))
        {
                LOGD("enter video delay is valid");
        }
@@ -6534,7 +6534,7 @@ static int __gst_adjust_video_position(mm_player_t* player, int offset)
                LOGD("enter video delay is crossing content boundary");
                return MM_ERROR_INVALID_ARGUMENT ;
        }
-       g_object_set (G_OBJECT (player->pipeline->videobin[MMPLAYER_V_SINK].gst),"ts-offset",((gint64) offset * G_GINT64_CONSTANT(1000000)),NULL);
+       g_object_set(G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst),"ts-offset", ((gint64) offset * G_GINT64_CONSTANT(1000000)),NULL);
        LOGD("video delay has been done");
        MMPLAYER_FLEAVE();
 
@@ -6550,19 +6550,19 @@ __gst_appsrc_feed_data_mem(GstElement *element, guint size, gpointer user_data)
        GstFlowReturn ret = GST_FLOW_OK;
        gint len = size;
 
-       MMPLAYER_RETURN_IF_FAIL ( element );
-       MMPLAYER_RETURN_IF_FAIL ( buf );
+       MMPLAYER_RETURN_IF_FAIL(element);
+       MMPLAYER_RETURN_IF_FAIL(buf);
 
-       buffer = gst_buffer_new ();
+       buffer = gst_buffer_new();
 
        if (buf->offset >= buf->len)
        {
                LOGD("call eos appsrc\n");
-               g_signal_emit_by_name (appsrc, "end-of-stream", &ret);
+               g_signal_emit_by_name(appsrc, "end-of-stream", &ret);
                return;
        }
 
-       if ( buf->len - buf->offset < size)
+       if (buf->len - buf->offset < size)
        {
                len = buf->len - buf->offset + buf->offset;
        }
@@ -6572,7 +6572,7 @@ __gst_appsrc_feed_data_mem(GstElement *element, guint size, gpointer user_data)
        GST_BUFFER_OFFSET_END(buffer) = (guint64)(buf->offset + len);
 
        //LOGD("feed buffer %p, offset %u-%u length %u\n", buffer, buf->offset, buf->len,len);
-       g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
+       g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret);
 
        buf->offset += len;
 }
@@ -6582,7 +6582,7 @@ __gst_appsrc_seek_data_mem(GstElement *element, guint64 size, gpointer user_data
 {
        tBuffer *buf = (tBuffer *)user_data;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( buf, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(buf, FALSE);
 
        buf->offset  = (int)size;
 
@@ -6595,7 +6595,7 @@ __gst_appsrc_feed_data(GstElement *element, guint size, gpointer user_data) // @
        mm_player_t *player  = (mm_player_t*)user_data;
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_DEFAULT;
        guint64 current_level_bytes=0;
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        LOGI("app-src: feed data\n");
 
@@ -6610,11 +6610,11 @@ __gst_appsrc_seek_data(GstElement *element, guint64 offset, gpointer user_data)
        mm_player_t *player  = (mm_player_t*)user_data;
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_DEFAULT;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        LOGI("app-src: seek data, offset: %llu\n", offset);
 
-       if(player->media_stream_seek_data_cb[type])
+       if (player->media_stream_seek_data_cb[type])
                player->media_stream_seek_data_cb[type](type, offset, player->buffer_cb_user_param);
 
        return TRUE;
@@ -6628,7 +6628,7 @@ __gst_appsrc_enough_data(GstElement *element, gpointer user_data) // @
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_DEFAULT;
        guint64 current_level_bytes=0;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        LOGI("app-src: enough data:%p\n", player->media_stream_buffer_status_cb[type]);
 
@@ -6651,18 +6651,18 @@ _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* check current state */
-//     MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_START );
+//     MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_START);
 
 
        /* NOTE : we should check and create pipeline again if not created as we destroy
         * whole pipeline when stopping in streamming playback
         */
-       if ( ! player->pipeline )
+       if (!player->pipeline)
        {
-               if ( MM_ERROR_NONE != __gst_realize( player ) )
+               if (MM_ERROR_NONE != __gst_realize(player))
                {
                        LOGE("failed to realize before starting. only in streamming\n");
                        return MM_ERROR_PLAYER_INTERNAL;
@@ -6671,25 +6671,25 @@ _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size) // @
 
        LOGI("app-src: pushing data\n");
 
-       if ( buf == NULL )
+       if (buf == NULL)
        {
                LOGE("buf is null\n");
                return MM_ERROR_NONE;
        }
 
-       buffer = gst_buffer_new ();
+       buffer = gst_buffer_new();
 
        if (size <= 0)
        {
                LOGD("call eos appsrc\n");
-               g_signal_emit_by_name (player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "end-of-stream", &gst_ret);
+               g_signal_emit_by_name(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "end-of-stream", &gst_ret);
                return MM_ERROR_NONE;
        }
 
        //gst_buffer_insert_memory(buffer, -1, gst_memory_new_wrapped(0, (guint8 *)(buf->buf + buf->offset), len, 0, len, (guint8*)(buf->buf + buf->offset), g_free));
 
        LOGD("feed buffer %p, length %u\n", buf, size);
-       g_signal_emit_by_name (player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "push-buffer", buffer, &gst_ret);
+       g_signal_emit_by_name(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "push-buffer", buffer, &gst_ret);
 
        MMPLAYER_FLEAVE();
 
@@ -6697,12 +6697,12 @@ _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size) // @
 }
 
 static GstBusSyncReply
-__mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
+__mmplayer_bus_sync_callback(GstBus * bus, GstMessage * message, gpointer data)
 {
        mm_player_t *player = (mm_player_t *)data;
        GstBusSyncReply reply = GST_BUS_DROP;
 
-       if ( ! ( player->pipeline && player->pipeline->mainbin ) )
+       if (!(player->pipeline && player->pipeline->mainbin))
        {
                LOGE("player pipeline handle is null");
                return GST_BUS_PASS;
@@ -6710,11 +6710,11 @@ __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
 
        if (!__mmplayer_check_useful_message(player, message))
        {
-               gst_message_unref (message);
+               gst_message_unref(message);
                return GST_BUS_DROP;
        }
 
-       switch (GST_MESSAGE_TYPE (message))
+       switch (GST_MESSAGE_TYPE(message))
        {
                case GST_MESSAGE_STATE_CHANGED:
                        /* post directly for fast launch */
@@ -6733,13 +6733,13 @@ __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
                        {
                                GstTagList *tags = NULL;
 
-                               gst_message_parse_tag (message, &tags);
+                               gst_message_parse_tag(message, &tags);
                                if (tags) {
                                        LOGE("TAGS received from element \"%s\".\n",
-                                       GST_STR_NULL (GST_ELEMENT_NAME (GST_MESSAGE_SRC (message))));
+                                       GST_STR_NULL(GST_ELEMENT_NAME(GST_MESSAGE_SRC(message))));
 
-                                       gst_tag_list_foreach (tags, print_tag, NULL);
-                                       gst_tag_list_free (tags);
+                                       gst_tag_list_foreach(tags, print_tag, NULL);
+                                       gst_tag_list_free(tags);
                                        tags = NULL;
                                }
                                break;
@@ -6760,13 +6760,13 @@ __mmplayer_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
        }
 
        if (reply == GST_BUS_DROP)
-               gst_message_unref (message);
+               gst_message_unref(message);
 
        return reply;
 }
 
 static gboolean
-__mmplayer_gst_create_decoder ( mm_player_t *player,
+__mmplayer_gst_create_decoder(mm_player_t *player,
                                                                MMPlayerTrackType track,
                                                                GstPad* srcpad,
                                                                enum MainElementID elemId,
@@ -6777,7 +6777,7 @@ __mmplayer_gst_create_decoder ( mm_player_t *player,
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player &&
+       MMPLAYER_RETURN_VAL_IF_FAIL(player &&
                                                player->pipeline &&
                                                player->pipeline->mainbin, FALSE);
        MMPLAYER_RETURN_VAL_IF_FAIL((track == MM_PLAYER_TRACK_TYPE_AUDIO || track == MM_PLAYER_TRACK_TYPE_VIDEO), FALSE);
@@ -6798,16 +6798,16 @@ __mmplayer_gst_create_decoder ( mm_player_t *player,
        }
 
        /* raw pad handling signal */
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
                                                                                G_CALLBACK(__mmplayer_gst_decode_pad_added), player);
 
        /* This signal is emitted whenever decodebin finds a new stream. It is emitted
        before looking for any elements that can handle that stream.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select",
                                                                                G_CALLBACK(__mmplayer_gst_decode_autoplug_select), player);
 
        /* This signal is emitted when a element is added to the bin.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added",
                                                                                G_CALLBACK(__mmplayer_gst_element_added), player);
 
        if (!gst_bin_add(GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), decodebin))
@@ -6817,10 +6817,10 @@ __mmplayer_gst_create_decoder ( mm_player_t *player,
                goto ERROR;
        }
 
-       dec_caps = gst_pad_query_caps (srcpad, NULL);
+       dec_caps = gst_pad_query_caps(srcpad, NULL);
        if (dec_caps)
        {
-               //LOGD ("got pad %s:%s , dec_caps %" GST_PTR_FORMAT, GST_DEBUG_PAD_NAME(srcpad), dec_caps);
+               //LOGD("got pad %s:%s , dec_caps %" GST_PTR_FORMAT, GST_DEBUG_PAD_NAME(srcpad), dec_caps);
                g_object_set(G_OBJECT(decodebin), "sink-caps", dec_caps, NULL);
                gst_caps_unref(dec_caps);
        }
@@ -6828,15 +6828,15 @@ __mmplayer_gst_create_decoder ( mm_player_t *player,
        player->pipeline->mainbin[elemId].id = elemId;
        player->pipeline->mainbin[elemId].gst = decodebin;
 
-       sinkpad = gst_element_get_static_pad (decodebin, "sink");
+       sinkpad = gst_element_get_static_pad(decodebin, "sink");
 
        if (GST_PAD_LINK_OK != gst_pad_link(srcpad, sinkpad))
        {
-               LOGW ("failed to link [%s:%s] to decoder\n", GST_DEBUG_PAD_NAME(srcpad));
-               gst_object_unref (GST_OBJECT(decodebin));
+               LOGW("failed to link [%s:%s] to decoder\n", GST_DEBUG_PAD_NAME(srcpad));
+               gst_object_unref(GST_OBJECT(decodebin));
        }
 
-       if (GST_STATE_CHANGE_FAILURE == gst_element_sync_state_with_parent (decodebin))
+       if (GST_STATE_CHANGE_FAILURE == gst_element_sync_state_with_parent(decodebin))
        {
                LOGE("failed to sync second level decodebin state with parent\n");
        }
@@ -6846,7 +6846,7 @@ __mmplayer_gst_create_decoder ( mm_player_t *player,
 ERROR:
        if (sinkpad)
        {
-               gst_object_unref ( GST_OBJECT(sinkpad) );
+               gst_object_unref(GST_OBJECT(sinkpad));
                sinkpad = NULL;
        }
        MMPLAYER_FLEAVE();
@@ -6887,37 +6887,37 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
        /* get profile attribute */
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute\n");
                goto INIT_ERROR;
        }
 
        /* create pipeline handles */
-       if ( player->pipeline )
+       if (player->pipeline)
        {
                LOGW("pipeline should be released before create new one\n");
                goto INIT_ERROR;
        }
 
-       player->pipeline = (MMPlayerGstPipelineInfo*) g_malloc0( sizeof(MMPlayerGstPipelineInfo) );
+       player->pipeline = (MMPlayerGstPipelineInfo*) g_malloc0(sizeof(MMPlayerGstPipelineInfo));
        if (player->pipeline == NULL)
                goto INIT_ERROR;
 
-       memset( player->pipeline, 0, sizeof(MMPlayerGstPipelineInfo) );
+       memset(player->pipeline, 0, sizeof(MMPlayerGstPipelineInfo));
 
 
        /* create mainbin */
-       mainbin = (MMPlayerGstElement*) g_malloc0( sizeof(MMPlayerGstElement) * MMPLAYER_M_NUM );
+       mainbin = (MMPlayerGstElement*) g_malloc0(sizeof(MMPlayerGstElement) * MMPLAYER_M_NUM);
        if (mainbin == NULL)
                goto INIT_ERROR;
 
-       memset( mainbin, 0, sizeof(MMPlayerGstElement) * MMPLAYER_M_NUM);
+       memset(mainbin, 0, sizeof(MMPlayerGstElement) * MMPLAYER_M_NUM);
 
        /* create pipeline */
        mainbin[MMPLAYER_M_PIPE].id = MMPLAYER_M_PIPE;
        mainbin[MMPLAYER_M_PIPE].gst = gst_pipeline_new("player");
-       if ( ! mainbin[MMPLAYER_M_PIPE].gst )
+       if (!mainbin[MMPLAYER_M_PIPE].gst)
        {
                LOGE("failed to create pipeline\n");
                goto INIT_ERROR;
@@ -6931,7 +6931,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
        _mmplayer_track_initialize(player);
 
        /* create source element */
-       switch ( player->profile.uri_type )
+       switch (player->profile.uri_type)
        {
                /* rtsp streamming */
                case MM_PLAYER_URI_TYPE_URL_RTSP:
@@ -6941,7 +6941,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
                        element = gst_element_factory_make("rtspsrc", "rtsp source");
 
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create streaming source element\n");
                                break;
@@ -6952,24 +6952,24 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        user_agent = wap_profile = NULL;
 
                        /* get attribute */
-                       mm_attrs_get_string_by_name ( attrs, "streaming_user_agent", &user_agent );
-                       mm_attrs_get_string_by_name ( attrs,"streaming_wap_profile", &wap_profile );
-                       mm_attrs_get_int_by_name ( attrs, "streaming_network_bandwidth", &network_bandwidth );
+                       mm_attrs_get_string_by_name(attrs, "streaming_user_agent", &user_agent);
+                       mm_attrs_get_string_by_name(attrs,"streaming_wap_profile", &wap_profile);
+                       mm_attrs_get_int_by_name(attrs, "streaming_network_bandwidth", &network_bandwidth);
 
                        SECURE_LOGD("user_agent : %s\n", user_agent);
                        SECURE_LOGD("wap_profile : %s\n", wap_profile);
 
                        /* setting property to streaming source */
                        g_object_set(G_OBJECT(element), "location", player->profile.uri, NULL);
-                       if ( user_agent )
+                       if (user_agent)
                                g_object_set(G_OBJECT(element), "user-agent", user_agent, NULL);
-                       if ( wap_profile )
+                       if (wap_profile)
                                g_object_set(G_OBJECT(element), "wap_profile", wap_profile, NULL);
 
-                       MMPLAYER_SIGNAL_CONNECT ( player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
-                               G_CALLBACK (__mmplayer_gst_rtp_dynamic_pad), player );
-                       MMPLAYER_SIGNAL_CONNECT ( player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
-                               G_CALLBACK (__mmplayer_gst_rtp_no_more_pads), player );
+                       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
+                               G_CALLBACK(__mmplayer_gst_rtp_dynamic_pad), player);
+                       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
+                               G_CALLBACK(__mmplayer_gst_rtp_no_more_pads), player);
 
                        player->use_decodebin = FALSE;
                }
@@ -6984,16 +6984,16 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        cookie_list = NULL;
                        gint mode = MM_PLAYER_PD_MODE_NONE;
 
-                       mm_attrs_get_int_by_name ( attrs, "pd_mode", &mode );
+                       mm_attrs_get_int_by_name(attrs, "pd_mode", &mode);
 
                        player->pd_mode = mode;
 
                        LOGD("http playback, PD mode : %d\n", player->pd_mode);
 
-                       if ( ! MMPLAYER_IS_HTTP_PD(player) )
+                       if (!MMPLAYER_IS_HTTP_PD(player))
                        {
                                element = gst_element_factory_make(player->ini.httpsrc_element, "http_streaming_source");
-                               if ( !element )
+                               if (!element)
                                {
                                        LOGE("failed to create http streaming source element[%s].\n", player->ini.httpsrc_element);
                                        break;
@@ -7001,10 +7001,10 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                LOGD("using http streamming source [%s].\n", player->ini.httpsrc_element);
 
                                /* get attribute */
-                               mm_attrs_get_string_by_name ( attrs, "streaming_cookie", &cookies );
-                               mm_attrs_get_string_by_name ( attrs, "streaming_user_agent", &user_agent );
-                               mm_attrs_get_string_by_name ( attrs, "streaming_proxy", &proxy );
-                               mm_attrs_get_int_by_name ( attrs, "streaming_timeout", &http_timeout );
+                               mm_attrs_get_string_by_name(attrs, "streaming_cookie", &cookies);
+                               mm_attrs_get_string_by_name(attrs, "streaming_user_agent", &user_agent);
+                               mm_attrs_get_string_by_name(attrs, "streaming_proxy", &proxy);
+                               mm_attrs_get_int_by_name(attrs, "streaming_timeout", &http_timeout);
 
                                if ((http_timeout == DEFAULT_HTTP_TIMEOUT) &&
                                        (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT))
@@ -7026,15 +7026,15 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                g_object_set(G_OBJECT(element), "blocksize", (unsigned long)(64*1024), NULL);
 
                                /* check if prosy is vailid or not */
-                               if ( util_check_valid_url ( proxy ) )
+                               if (util_check_valid_url(proxy))
                                        g_object_set(G_OBJECT(element), "proxy", proxy, NULL);
                                /* parsing cookies */
-                               if ( ( cookie_list = util_get_cookie_list ((const char*)cookies) ) )
+                               if ((cookie_list = util_get_cookie_list((const char*)cookies)))
                                        g_object_set(G_OBJECT(element), "cookies", cookie_list, NULL);
-                               if ( user_agent )
+                               if (user_agent)
                                        g_object_set(G_OBJECT(element), "user-agent", user_agent, NULL);
 
-                               if ( MMPLAYER_URL_HAS_DASH_SUFFIX(player) )
+                               if (MMPLAYER_URL_HAS_DASH_SUFFIX(player))
                                {
                                        LOGW("it's dash. and it's still experimental feature.");
                                }
@@ -7047,13 +7047,13 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                {
                                        gchar *path = NULL;
 
-                                       mm_attrs_get_string_by_name ( attrs, "pd_location", &path );
+                                       mm_attrs_get_string_by_name(attrs, "pd_location", &path);
 
                                        MMPLAYER_FREEIF(player->pd_file_save_path);
 
                                        LOGD("PD Location : %s\n", path);
 
-                                       if ( path )
+                                       if (path)
                                        {
                                                player->pd_file_save_path = g_strdup(path);
                                        }
@@ -7065,7 +7065,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                }
 
                                element = gst_element_factory_make("pdpushsrc", "PD pushsrc");
-                               if ( !element )
+                               if (!element)
                                {
                                        LOGE("failed to create PD push source element[%s].\n", "pdpushsrc");
                                        break;
@@ -7079,7 +7079,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                g_object_get(element, "location", &location, NULL);
                                LOGD("PD_LOCATION [%s].\n", location);
                                if (location)
-                                       g_free (location);
+                                       g_free(location);
                        }
                }
                break;
@@ -7092,7 +7092,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
                        element = gst_element_factory_make("filesrc", "source");
 
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create filesrc\n");
                                break;
@@ -7107,13 +7107,13 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                {
                        gint http_timeout = DEFAULT_HTTP_TIMEOUT;
                        element = gst_element_factory_make("souphttpsrc", "http streaming source");
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create http streaming source element[%s]", player->ini.httpsrc_element);
                                break;
                        }
 
-                       mm_attrs_get_int_by_name ( attrs, "streaming_timeout", &http_timeout );
+                       mm_attrs_get_int_by_name(attrs, "streaming_timeout", &http_timeout);
 
                        if ((http_timeout == DEFAULT_HTTP_TIMEOUT) &&
                                (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT))
@@ -7136,21 +7136,21 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        LOGD("mem src is selected\n");
 
                        element = gst_element_factory_make("appsrc", "buff-source");
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create appsrc element\n");
                                break;
                        }
 
-                       g_object_set( element, "stream-type", stream_type, NULL );
-                       //g_object_set( element, "size", player->mem_buf.len, NULL );
-                       //g_object_set( element, "blocksize", (guint64)20480, NULL );
+                       g_object_set(element, "stream-type", stream_type, NULL);
+                       //g_object_set(element, "size", player->mem_buf.len, NULL);
+                       //g_object_set(element, "blocksize", (guint64)20480, NULL);
 
-                       MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
+                       MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
                                G_CALLBACK(__gst_appsrc_seek_data), player);
-                       MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
+                       MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
                                G_CALLBACK(__gst_appsrc_feed_data), player);
-                       MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
+                       MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
                                G_CALLBACK(__gst_appsrc_enough_data), player);
                }
                break;
@@ -7161,39 +7161,39 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        if (player->v_stream_caps)
                        {
                                element = gst_element_factory_make("appsrc", "video_appsrc");
-                               if ( !element )
+                               if (!element)
                                {
-                                       LOGF("failed to create video app source element[appsrc].\n" );
+                                       LOGF("failed to create video app source element[appsrc].\n");
                                        break;
                                }
 
-                               if ( player->a_stream_caps )
+                               if (player->a_stream_caps)
                                {
                                        elem_src_audio = gst_element_factory_make("appsrc", "audio_appsrc");
-                                       if ( !elem_src_audio )
+                                       if (!elem_src_audio)
                                        {
-                                               LOGF("failed to create audio app source element[appsrc].\n" );
+                                               LOGF("failed to create audio app source element[appsrc].\n");
                                                break;
                                        }
                                }
                        }
-                       else if ( player->a_stream_caps )
+                       else if (player->a_stream_caps)
                        {
                                /* no video, only audio pipeline*/
                                element = gst_element_factory_make("appsrc", "audio_appsrc");
-                               if ( !element )
+                               if (!element)
                                {
-                                       LOGF("failed to create audio app source element[appsrc].\n" );
+                                       LOGF("failed to create audio app source element[appsrc].\n");
                                        break;
                                }
                        }
 
-                       if ( player->s_stream_caps )
+                       if (player->s_stream_caps)
                        {
                                elem_src_subtitle = gst_element_factory_make("appsrc", "subtitle_appsrc");
-                               if ( !elem_src_subtitle )
+                               if (!elem_src_subtitle)
                                {
-                                       LOGF("failed to create subtitle app source element[appsrc].\n" );
+                                       LOGF("failed to create subtitle app source element[appsrc].\n");
                                        break;
                                }
                        }
@@ -7201,20 +7201,20 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        LOGD("setting app sources properties.\n");
                        LOGD("location : %s\n", player->profile.uri);
 
-                       if ( player->v_stream_caps && element )
+                       if (player->v_stream_caps && element)
                        {
                                g_object_set(G_OBJECT(element), "format", GST_FORMAT_TIME,
                                                                                            "blocksize", (guint)1048576,        /* size of many video frames are larger than default blocksize as 4096 */
                                                                                                "caps", player->v_stream_caps, NULL);
 
-                               if ( player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_VIDEO] > 0)
+                               if (player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_VIDEO] > 0)
                                        g_object_set(G_OBJECT(element), "max-bytes", player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_VIDEO], NULL);
-                               if ( player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_VIDEO] > 0)
+                               if (player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_VIDEO] > 0)
                                        g_object_set(G_OBJECT(element), "min-percent", player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_VIDEO], NULL);
 
                                /*Fix Seek External Demuxer:  set audio and video appsrc as seekable */
                                gst_app_src_set_stream_type((GstAppSrc*)G_OBJECT(element), GST_APP_STREAM_TYPE_SEEKABLE);
-                               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
                                                                                                                G_CALLBACK(__gst_seek_video_data), player);
 
                                if (player->a_stream_caps && elem_src_audio)
@@ -7222,14 +7222,14 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                        g_object_set(G_OBJECT(elem_src_audio), "format", GST_FORMAT_TIME,
                                                                                                                        "caps", player->a_stream_caps, NULL);
 
-                                       if ( player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
+                                       if (player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
                                                g_object_set(G_OBJECT(elem_src_audio), "max-bytes", player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_AUDIO], NULL);
-                                       if ( player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
+                                       if (player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
                                                g_object_set(G_OBJECT(elem_src_audio), "min-percent", player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_AUDIO], NULL);
 
                                        /*Fix Seek External Demuxer:  set audio and video appsrc as seekable */
                                        gst_app_src_set_stream_type((GstAppSrc*)G_OBJECT(elem_src_audio), GST_APP_STREAM_TYPE_SEEKABLE);
-                                       MMPLAYER_SIGNAL_CONNECT( player, elem_src_audio, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
+                                       MMPLAYER_SIGNAL_CONNECT(player, elem_src_audio, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
                                                                                                                G_CALLBACK(__gst_seek_audio_data), player);
                                }
                        }
@@ -7238,14 +7238,14 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                g_object_set(G_OBJECT(element), "format", GST_FORMAT_TIME,
                                                                                                "caps", player->a_stream_caps, NULL);
 
-                               if ( player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
+                               if (player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
                                        g_object_set(G_OBJECT(element), "max-bytes", player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_AUDIO], NULL);
-                               if ( player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
+                               if (player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_AUDIO] > 0)
                                        g_object_set(G_OBJECT(element), "min-percent", player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_AUDIO], NULL);
 
                                /*Fix Seek External Demuxer:  set audio and video appsrc as seekable */
                                gst_app_src_set_stream_type((GstAppSrc*)G_OBJECT(element), GST_APP_STREAM_TYPE_SEEKABLE);
-                               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
                                                                                                                        G_CALLBACK(__gst_seek_audio_data), player);
                        }
 
@@ -7254,50 +7254,50 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                g_object_set(G_OBJECT(elem_src_subtitle), "format", GST_FORMAT_TIME,
                                                                                                                 "caps", player->s_stream_caps, NULL);
 
-                               if ( player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_TEXT] > 0)
+                               if (player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_TEXT] > 0)
                                        g_object_set(G_OBJECT(elem_src_subtitle), "max-bytes", player->media_stream_buffer_max_size[MM_PLAYER_STREAM_TYPE_TEXT], NULL);
-                               if ( player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_TEXT] > 0)
+                               if (player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_TEXT] > 0)
                                        g_object_set(G_OBJECT(elem_src_subtitle), "min-percent", player->media_stream_buffer_min_percent[MM_PLAYER_STREAM_TYPE_TEXT], NULL);
 
                                gst_app_src_set_stream_type((GstAppSrc*)G_OBJECT(elem_src_subtitle), GST_APP_STREAM_TYPE_SEEKABLE);
 
-                               MMPLAYER_SIGNAL_CONNECT( player, elem_src_subtitle, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, elem_src_subtitle, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
                                                                                                                                G_CALLBACK(__gst_seek_subtitle_data), player);
                        }
 
                        if (player->v_stream_caps && element)
                        {
-                               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
                                                                                                                G_CALLBACK(__gst_appsrc_feed_video_data), player);
-                               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
                                                                                                                G_CALLBACK(__gst_appsrc_enough_video_data), player);
 
                                if (player->a_stream_caps && elem_src_audio)
                                {
-                                       MMPLAYER_SIGNAL_CONNECT( player, elem_src_audio, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
+                                       MMPLAYER_SIGNAL_CONNECT(player, elem_src_audio, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
                                                                                                                G_CALLBACK(__gst_appsrc_feed_audio_data), player);
-                                       MMPLAYER_SIGNAL_CONNECT( player, elem_src_audio, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
+                                       MMPLAYER_SIGNAL_CONNECT(player, elem_src_audio, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
                                                                                                                G_CALLBACK(__gst_appsrc_enough_audio_data), player);
                                }
                        }
                        else if (player->a_stream_caps && element)
                        {
-                               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
                                                                                                                G_CALLBACK(__gst_appsrc_feed_audio_data), player);
-                               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "enough-data",
                                                                                                                G_CALLBACK(__gst_appsrc_enough_audio_data), player);
                        }
 
                        if (player->s_stream_caps && elem_src_subtitle)
                        {
-                               MMPLAYER_SIGNAL_CONNECT( player, elem_src_subtitle, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
+                               MMPLAYER_SIGNAL_CONNECT(player, elem_src_subtitle, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
                                                                                                                G_CALLBACK(__gst_appsrc_feed_subtitle_data), player);
                        }
 
                        need_state_holder = FALSE;
 
-                       mm_attrs_set_int_by_name ( attrs, "profile_prepare_async", TRUE );
-                       if ( mmf_attrs_commit ( attrs ) ) /* return -1 if error */
+                       mm_attrs_set_int_by_name(attrs, "profile_prepare_async", TRUE);
+                       if (mmf_attrs_commit(attrs)) /* return -1 if error */
                                LOGE("failed to commit\n");
                }
                break;
@@ -7309,20 +7309,20 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        LOGD("mem src is selected\n");
 
                        element = gst_element_factory_make("appsrc", "mem-source");
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create appsrc element\n");
                                break;
                        }
 
-                       g_object_set( element, "stream-type", stream_type, NULL );
-                       g_object_set( element, "size", player->mem_buf.len, NULL );
-                       g_object_set( element, "blocksize", (guint64)20480, NULL );
+                       g_object_set(element, "stream-type", stream_type, NULL);
+                       g_object_set(element, "size", player->mem_buf.len, NULL);
+                       g_object_set(element, "blocksize", (guint64)20480, NULL);
 
-                       MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
-                               G_CALLBACK(__gst_appsrc_seek_data_mem), &player->mem_buf );
-                       MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
-                               G_CALLBACK(__gst_appsrc_feed_data_mem), &player->mem_buf );
+                       MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "seek-data",
+                               G_CALLBACK(__gst_appsrc_seek_data_mem), &player->mem_buf);
+                       MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_OTHERS, "need-data",
+                               G_CALLBACK(__gst_appsrc_feed_data_mem), &player->mem_buf);
                }
                break;
                case MM_PLAYER_URI_TYPE_URL:
@@ -7337,7 +7337,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
        }
 
        /* check source element is OK */
-       if ( ! element )
+       if (!element)
        {
                LOGE("no source element was created.\n");
                goto INIT_ERROR;
@@ -7354,15 +7354,15 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                __mm_player_streaming_initialize(player->streamer);
        }
 
-       if ( MMPLAYER_IS_HTTP_PD(player) )
+       if (MMPLAYER_IS_HTTP_PD(player))
        {
                gdouble pre_buffering_time = (gdouble)player->streamer->buffering_req.initial_second;
 
-               LOGD ("Picked queue2 element(pre buffer : %d sec)....\n", pre_buffering_time);
+               LOGD("Picked queue2 element(pre buffer : %d sec)....\n", pre_buffering_time);
                element = gst_element_factory_make("queue2", "queue2");
-               if ( !element )
+               if (!element)
                {
-                       LOGE ( "failed to create http streaming buffer element\n" );
+                       LOGE("failed to create http streaming buffer element\n");
                        goto INIT_ERROR;
                }
 
@@ -7391,7 +7391,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        es_video_queue = gst_element_factory_make("queue2", "video_queue");
                        if (!es_video_queue)
                        {
-                               LOGE ("create es_video_queue for es player failed\n");
+                               LOGE("create es_video_queue for es player failed\n");
                                goto INIT_ERROR;
                        }
                        g_object_set(G_OBJECT(es_video_queue), "max-size-buffers", 2, NULL);
@@ -7409,7 +7409,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                                es_audio_queue = gst_element_factory_make("queue2", "audio_queue");
                                if (!es_audio_queue)
                                {
-                                       LOGE ("create es_audio_queue for es player failed\n");
+                                       LOGE("create es_audio_queue for es player failed\n");
                                        goto INIT_ERROR;
                                }
                                g_object_set(G_OBJECT(es_audio_queue), "max-size-buffers", 2, NULL);
@@ -7425,7 +7425,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        es_audio_queue = gst_element_factory_make("queue2", "audio_queue");
                        if (!es_audio_queue)
                        {
-                               LOGE ("create es_audio_queue for es player failed\n");
+                               LOGE("create es_audio_queue for es player failed\n");
                                goto INIT_ERROR;
                        }
                        mainbin[MMPLAYER_M_A_BUFFER].id = MMPLAYER_M_A_BUFFER;
@@ -7442,7 +7442,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        es_subtitle_queue = gst_element_factory_make("queue2", "subtitle_queue");
                        if (!es_subtitle_queue)
                        {
-                               LOGE ("create es_subtitle_queue for es player failed\n");
+                               LOGE("create es_subtitle_queue for es player failed\n");
                                goto INIT_ERROR;
                        }
                        mainbin[MMPLAYER_M_S_BUFFER].id = MMPLAYER_M_V_BUFFER;
@@ -7461,7 +7461,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
                if ((player->use_decodebin) &&
                        ((MMPLAYER_IS_HTTP_PD(player)) ||
-                        (!MMPLAYER_IS_HTTP_STREAMING(player))))
+                       (!MMPLAYER_IS_HTTP_STREAMING(player))))
                {
                        elemId = MMPLAYER_M_AUTOPLUG;
                        element = __mmplayer_create_decodebin(player);
@@ -7471,15 +7471,15 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                {
                        elemId = MMPLAYER_M_TYPEFIND;
                        element = gst_element_factory_make("typefind", "typefinder");
-                       MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type",
-                               G_CALLBACK(__mmplayer_typefind_have_type), (gpointer)player );
+                       MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type",
+                               G_CALLBACK(__mmplayer_typefind_have_type), (gpointer)player);
                }
 
 
                /* check autoplug element is OK */
-               if ( ! element )
+               if (!element)
                {
-                       LOGE("can not create element (%d)\n", elemId);
+                       LOGE("can not create element(%d)\n", elemId);
                        goto INIT_ERROR;
                }
 
@@ -7490,7 +7490,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
        }
 
        /* add elements to pipeline */
-       if!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element_bucket))
+       if (!__mmplayer_gst_element_add_bucket_to_bin(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element_bucket))
        {
                LOGE("Failed to add elements to pipeline\n");
                goto INIT_ERROR;
@@ -7498,7 +7498,7 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
 
        /* linking elements in the bucket by added order. */
-       if ( __mmplayer_gst_element_link_bucket(element_bucket) == -1 )
+       if (__mmplayer_gst_element_link_bucket(element_bucket) == -1)
        {
                LOGE("Failed to link some elements\n");
                goto INIT_ERROR;
@@ -7506,25 +7506,25 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
 
        /* create fakesink element for keeping the pipeline state PAUSED. if needed */
-       if ( need_state_holder )
+       if (need_state_holder)
        {
                /* create */
                mainbin[MMPLAYER_M_SRC_FAKESINK].id = MMPLAYER_M_SRC_FAKESINK;
-               mainbin[MMPLAYER_M_SRC_FAKESINK].gst = gst_element_factory_make ("fakesink", "state-holder");
+               mainbin[MMPLAYER_M_SRC_FAKESINK].gst = gst_element_factory_make("fakesink", "state-holder");
 
                if (!mainbin[MMPLAYER_M_SRC_FAKESINK].gst)
                {
-                       LOGE ("fakesink element could not be created\n");
+                       LOGE("fakesink element could not be created\n");
                        goto INIT_ERROR;
                }
-               GST_OBJECT_FLAG_UNSET (mainbin[MMPLAYER_M_SRC_FAKESINK].gst, GST_ELEMENT_FLAG_SINK);
+               GST_OBJECT_FLAG_UNSET(mainbin[MMPLAYER_M_SRC_FAKESINK].gst, GST_ELEMENT_FLAG_SINK);
 
                /* take ownership of fakesink. we are reusing it */
-               gst_object_ref( mainbin[MMPLAYER_M_SRC_FAKESINK].gst );
+               gst_object_ref(mainbin[MMPLAYER_M_SRC_FAKESINK].gst);
 
                /* add */
-               if ( FALSE == gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst),
-                       mainbin[MMPLAYER_M_SRC_FAKESINK].gst) )
+               if (FALSE == gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst),
+                       mainbin[MMPLAYER_M_SRC_FAKESINK].gst))
                {
                        LOGE("failed to add fakesink to bin\n");
                        goto INIT_ERROR;
@@ -7543,13 +7543,13 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        srcpad = gst_element_get_static_pad(mainbin[MMPLAYER_M_V_BUFFER].gst, "src");
                        if (srcpad)
                        {
-                               __mmplayer_gst_create_decoder ( player,
+                               __mmplayer_gst_create_decoder(player,
                                                                                                MM_PLAYER_TRACK_TYPE_VIDEO,
                                                                                                srcpad,
                                                                                                MMPLAYER_M_AUTOPLUG_V_DEC,
                                                                                                "video_decodebin");
 
-                               gst_object_unref ( GST_OBJECT(srcpad) );
+                               gst_object_unref(GST_OBJECT(srcpad));
                                srcpad = NULL;
                        }
                }
@@ -7559,13 +7559,13 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
                        srcpad = gst_element_get_static_pad(mainbin[MMPLAYER_M_A_BUFFER].gst, "src");
                        if (srcpad)
                        {
-                               __mmplayer_gst_create_decoder ( player,
+                               __mmplayer_gst_create_decoder(player,
                                                                                                MM_PLAYER_TRACK_TYPE_AUDIO,
                                                                                                srcpad,
                                                                                                MMPLAYER_M_AUTOPLUG_A_DEC,
                                                                                                "audio_decodebin");
 
-                               gst_object_unref ( GST_OBJECT(srcpad) );
+                               gst_object_unref(GST_OBJECT(srcpad));
                                srcpad = NULL;
                        } // else error
                } //  else error
@@ -7578,9 +7578,9 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
 
        /* connect bus callback */
        bus = gst_pipeline_get_bus(GST_PIPELINE(mainbin[MMPLAYER_M_PIPE].gst));
-       if ( !bus )
+       if (!bus)
        {
-               LOGE ("cannot get bus from pipeline.\n");
+               LOGE("cannot get bus from pipeline.\n");
                goto INIT_ERROR;
        }
 
@@ -7596,9 +7596,9 @@ __mmplayer_gst_create_pipeline(mm_player_t* player) // @
        LOGW("bus watcher thread context = %p, watcher : %d", player->context.thread_default, player->bus_watcher);
 
        /* Note : check whether subtitle atrribute uri is set. If uri is set, then try to play subtitle file */
-       if ( __mmplayer_check_subtitle ( player ) )
+       if (__mmplayer_check_subtitle(player))
        {
-               if ( MM_ERROR_NONE != __mmplayer_gst_create_subtitle_src(player) )
+               if (MM_ERROR_NONE != __mmplayer_gst_create_subtitle_src(player))
                        LOGE("fail to create subtitle src\n");
        }
 
@@ -7621,14 +7621,14 @@ INIT_ERROR:
        if (mainbin)
        {
                /* release element which are not added to bin */
-               for ( i = 1; i < MMPLAYER_M_NUM; i++ )  /* NOTE : skip pipeline */
+               for (i = 1; i < MMPLAYER_M_NUM; i++)    /* NOTE : skip pipeline */
                {
-                       if ( mainbin[i].gst )
+                       if (mainbin[i].gst)
                        {
                                GstObject* parent = NULL;
-                               parent = gst_element_get_parent( mainbin[i].gst );
+                               parent = gst_element_get_parent(mainbin[i].gst);
 
-                               if ( !parent )
+                               if (!parent)
                                {
                                        gst_object_unref(GST_OBJECT(mainbin[i].gst));
                                        mainbin[i].gst = NULL;
@@ -7641,15 +7641,15 @@ INIT_ERROR:
                }
 
                /* release pipeline with it's childs */
-               if ( mainbin[MMPLAYER_M_PIPE].gst )
+               if (mainbin[MMPLAYER_M_PIPE].gst)
                {
                        gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_PIPE].gst));
                }
 
-               MMPLAYER_FREEIF( mainbin );
+               MMPLAYER_FREEIF(mainbin);
        }
 
-       MMPLAYER_FREEIF( player->pipeline );
+       MMPLAYER_FREEIF(player->pipeline);
        return MM_ERROR_PLAYER_INTERNAL;
 }
 
@@ -7676,7 +7676,7 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_INVALID_HANDLE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_INVALID_HANDLE);
 
        /* cleanup stuffs */
        MMPLAYER_FREEIF(player->type);
@@ -7694,7 +7694,7 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
 
        if (player->streamer)
        {
-               __mm_player_streaming_deinitialize (player->streamer);
+               __mm_player_streaming_deinitialize(player->streamer);
                __mm_player_streaming_destroy(player->streamer);
                player->streamer = NULL;
        }
@@ -7705,34 +7705,34 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
        MMPLAYER_FREEIF(player->unlinked_demuxer_mime);
 
        /* cleanup running stuffs */
-       __mmplayer_cancel_eos_timer( player );
+       __mmplayer_cancel_eos_timer(player);
 
        /* cleanup gst stuffs */
-       if ( player->pipeline )
+       if (player->pipeline)
        {
                MMPlayerGstElement* mainbin = player->pipeline->mainbin;
                GstTagList* tag_list = player->pipeline->tag_list;
 
                /* first we need to disconnect all signal hander */
-               __mmplayer_release_signal_connection( player, MM_PLAYER_SIGNAL_TYPE_ALL );
+               __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_ALL);
 
                /* disconnecting bus watch */
-               if ( player->bus_watcher )
+               if (player->bus_watcher)
                        __mmplayer_remove_g_source_from_context(player->context.thread_default, player->bus_watcher);
                player->bus_watcher = 0;
 
-               if ( mainbin )
+               if (mainbin)
                {
                        MMPlayerGstElement* audiobin = player->pipeline->audiobin;
                        MMPlayerGstElement* videobin = player->pipeline->videobin;
                        MMPlayerGstElement* textbin = player->pipeline->textbin;
-                       GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (mainbin[MMPLAYER_M_PIPE].gst));
-                       gst_bus_set_sync_handler (bus, NULL, NULL, NULL);
+                       GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(mainbin[MMPLAYER_M_PIPE].gst));
+                       gst_bus_set_sync_handler(bus, NULL, NULL, NULL);
                        gst_object_unref(bus);
 
                        timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player);
-                       ret = __mmplayer_gst_set_state ( player, mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_NULL, FALSE, timeout );
-                       if ( ret != MM_ERROR_NONE )
+                       ret = __mmplayer_gst_set_state(player, mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_NULL, FALSE, timeout);
+                       if (ret != MM_ERROR_NONE)
                        {
                                LOGE("fail to change state to NULL\n");
                                return MM_ERROR_PLAYER_INTERNAL;
@@ -7743,23 +7743,23 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
                        gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_PIPE].gst));
 
                        /* free fakesink */
-                       if ( mainbin[MMPLAYER_M_SRC_FAKESINK].gst )
+                       if (mainbin[MMPLAYER_M_SRC_FAKESINK].gst)
                                gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_SRC_FAKESINK].gst));
 
                        /* free avsysaudiosink
                           avsysaudiosink should be unref when destory pipeline just after start play with BT.
                           Because audiosink is created but never added to bin, and therefore it will not be unref when pipeline is destroyed.
                        */
-                       MMPLAYER_FREEIF( audiobin );
-                       MMPLAYER_FREEIF( videobin );
-                       MMPLAYER_FREEIF( textbin );
-                       MMPLAYER_FREEIF( mainbin );
+                       MMPLAYER_FREEIF(audiobin);
+                       MMPLAYER_FREEIF(videobin);
+                       MMPLAYER_FREEIF(textbin);
+                       MMPLAYER_FREEIF(mainbin);
                }
 
-               if ( tag_list )
+               if (tag_list)
                        gst_tag_list_free(tag_list);
 
-               MMPLAYER_FREEIF( player->pipeline );
+               MMPLAYER_FREEIF(player->pipeline);
        }
        MMPLAYER_FREEIF(player->album_art);
 
@@ -7782,11 +7782,11 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
        _mmplayer_track_destroy(player);
 
        if (player->sink_elements)
-               g_list_free ( player->sink_elements );
+               g_list_free(player->sink_elements);
        player->sink_elements = NULL;
 
        if (player->bufmgr) {
-               tbm_bufmgr_deinit ( player->bufmgr );
+               tbm_bufmgr_deinit(player->bufmgr);
                player->bufmgr = NULL;
        }
 
@@ -7809,7 +7809,7 @@ static int __gst_realize(mm_player_t* player) // @
        MMPLAYER_PENDING_STATE(player) = MM_PLAYER_STATE_READY;
 
        ret = __mmplayer_gst_create_pipeline(player);
-       if ( ret )
+       if (ret)
        {
                LOGE("failed to create pipeline\n");
                return ret;
@@ -7821,7 +7821,7 @@ static int __gst_realize(mm_player_t* player) // @
        ret = __mmplayer_gst_set_state(player,
                                player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_READY, FALSE, timeout);
 
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                /* return error if failed to set state */
                LOGE("failed to set READY state");
@@ -7829,11 +7829,11 @@ static int __gst_realize(mm_player_t* player) // @
        }
        else
        {
-               MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_READY );
+               MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_READY);
        }
 
        /* create dot before error-return. for debugging */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-realize" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-realize");
 
        MMPLAYER_FLEAVE();
 
@@ -7852,11 +7852,11 @@ static int __gst_unrealize(mm_player_t* player) // @
        MMPLAYER_PRINT_STATE(player);
 
        /* release miscellaneous information */
-       __mmplayer_release_misc( player );
+       __mmplayer_release_misc(player);
 
        /* destroy pipeline */
-       ret = __mmplayer_gst_destroy_pipeline( player );
-       if ( ret != MM_ERROR_NONE )
+       ret = __mmplayer_gst_destroy_pipeline(player);
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to destory pipeline\n");
                return ret;
@@ -7864,45 +7864,45 @@ static int __gst_unrealize(mm_player_t* player) // @
 
        /* release miscellaneous information.
           these info needs to be released after pipeline is destroyed. */
-       __mmplayer_release_misc_post( player );
+       __mmplayer_release_misc_post(player);
 
-       MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_NULL );
+       MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_NULL);
 
        MMPLAYER_FLEAVE();
 
        return ret;
 }
 
-static int __gst_pending_seek ( mm_player_t* player )
+static int __gst_pending_seek(mm_player_t* player)
 {
        MMPlayerStateType current_state = MM_PLAYER_STATE_NONE;
        int ret = MM_ERROR_NONE;
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       if ( !player->pending_seek.is_pending )
+       if (!player->pending_seek.is_pending)
        {
-               LOGD("pending seek is not reserved. nothing to do.\n" );
+               LOGD("pending seek is not reserved. nothing to do.\n");
                return ret;
        }
 
        /* check player state if player could pending seek or not. */
        current_state = MMPLAYER_CURRENT_STATE(player);
 
-       if ( current_state != MM_PLAYER_STATE_PAUSED && current_state != MM_PLAYER_STATE_PLAYING  )
+       if (current_state != MM_PLAYER_STATE_PAUSED && current_state != MM_PLAYER_STATE_PLAYING )
        {
                LOGW("try to pending seek in %s state, try next time. \n",
                        MMPLAYER_STATE_GET_NAME(current_state));
                return ret;
        }
 
-       LOGD("trying to play from (%lu) pending position\n", player->pending_seek.pos);
+       LOGD("trying to play from(%lu) pending position\n", player->pending_seek.pos);
 
-       ret = __gst_set_position ( player, player->pending_seek.format, player->pending_seek.pos, FALSE );
+       ret = __gst_set_position(player, player->pending_seek.format, player->pending_seek.pos, FALSE);
 
-       if ( MM_ERROR_NONE != ret )
+       if (MM_ERROR_NONE != ret)
                LOGE("failed to seek pending postion. just keep staying current position.\n");
 
        player->pending_seek.is_pending = FALSE;
@@ -7920,19 +7920,19 @@ static int __gst_start(mm_player_t* player) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* get sound_extraction property */
        mm_attrs_get_int_by_name(player->attrs, "pcm_extraction", &sound_extraction);
 
        /* NOTE : if SetPosition was called before Start. do it now */
        /* streaming doesn't support it. so it should be always sync */
-       /* !! create one more api to check if there is pending seek rather than checking variables */
-       if ( (player->pending_seek.is_pending || sound_extraction) && !MMPLAYER_IS_STREAMING(player))
+       /* !!create one more api to check if there is pending seek rather than checking variables */
+       if ((player->pending_seek.is_pending || sound_extraction) && !MMPLAYER_IS_STREAMING(player))
        {
                MMPLAYER_TARGET_STATE(player) = MM_PLAYER_STATE_PAUSED;
                ret = __gst_pause(player, FALSE);
-               if ( ret != MM_ERROR_NONE )
+               if (ret != MM_ERROR_NONE)
                {
                        LOGE("failed to set state to PAUSED for pending seek\n");
                        return ret;
@@ -7940,12 +7940,12 @@ static int __gst_start(mm_player_t* player) // @
 
                MMPLAYER_TARGET_STATE(player) = MM_PLAYER_STATE_PLAYING;
 
-               if ( sound_extraction )
+               if (sound_extraction)
                {
                        LOGD("setting pcm extraction\n");
 
                        ret = __mmplayer_set_pcm_extraction(player);
-                       if ( MM_ERROR_NONE != ret )
+                       if (MM_ERROR_NONE != ret)
                        {
                                LOGW("failed to set pcm extraction\n");
                                return ret;
@@ -7953,7 +7953,7 @@ static int __gst_start(mm_player_t* player) // @
                }
                else
                {
-                       if ( MM_ERROR_NONE != __gst_pending_seek(player) )
+                       if (MM_ERROR_NONE != __gst_pending_seek(player))
                        {
                                LOGW("failed to seek pending postion. starting from the begin of content.\n");
                        }
@@ -7971,7 +7971,7 @@ static int __gst_start(mm_player_t* player) // @
        }
        /* set pipeline state to PLAYING  */
        ret = __mmplayer_gst_set_state(player,
-               player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, MMPLAYER_STATE_CHANGE_TIMEOUT(player) );
+               player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, MMPLAYER_STATE_CHANGE_TIMEOUT(player));
 
        if (ret == MM_ERROR_NONE)
        {
@@ -7984,7 +7984,7 @@ static int __gst_start(mm_player_t* player) // @
        }
 
        /* generating debug info before returning error */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-start" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-start");
 
        MMPLAYER_FLEAVE();
 
@@ -8034,15 +8034,15 @@ static int __gst_stop(mm_player_t* player) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player->pipeline->mainbin, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline->mainbin, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        LOGD("current state before doing transition");
        MMPLAYER_PENDING_STATE(player) = MM_PLAYER_STATE_READY;
        MMPLAYER_PRINT_STATE(player);
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("cannot get content attribute\n");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -8055,7 +8055,7 @@ static int __gst_stop(mm_player_t* player) // @
                __mmplayer_do_sound_fadedown(player, MM_PLAYER_FADEOUT_TIME_DEFAULT);
 
        /* Just set state to PAUESED and the rewind. it's usual player behavior. */
-       timeout = MMPLAYER_STATE_CHANGE_TIMEOUT ( player );
+       timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player);
 
        if (player->profile.uri_type == MM_PLAYER_URI_TYPE_BUFF ||
                player->profile.uri_type == MM_PLAYER_URI_TYPE_HLS)
@@ -8066,7 +8066,7 @@ static int __gst_stop(mm_player_t* player) // @
        {
                state = GST_STATE_PAUSED;
 
-               if ( ! MMPLAYER_IS_STREAMING(player) ||
+               if (!MMPLAYER_IS_STREAMING(player) ||
                        (player->streaming_type == STREAMING_SERVICE_VOD && player->videodec_linked)) {
                        rewind = TRUE;
                }
@@ -8077,25 +8077,25 @@ static int __gst_stop(mm_player_t* player) // @
                async = TRUE;
        }
        /* set gst state */
-       ret = __mmplayer_gst_set_state( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, state, async, timeout );
+       ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, state, async, timeout);
 
        /* disable fadeout */
        if (fadedown || player->sound_focus.by_asm_cb)
                __mmplayer_undo_sound_fadedown(player);
 
        /* return if set_state has failed */
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to set state.\n");
                return ret;
        }
 
        /* rewind */
-       if ( rewind )
+       if (rewind)
        {
-               if ( ! __gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
+               if (!__gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, 0,
-                               GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE) )
+                               GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
                {
                        LOGW("failed to rewind\n");
                        ret = MM_ERROR_PLAYER_SEEK;
@@ -8111,10 +8111,10 @@ static int __gst_stop(mm_player_t* player) // @
        }
 
        /* wait for seek to complete */
-       change_ret = gst_element_get_state (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, NULL, NULL, timeout * GST_SECOND);
-       if ( change_ret == GST_STATE_CHANGE_SUCCESS || change_ret == GST_STATE_CHANGE_NO_PREROLL )
+       change_ret = gst_element_get_state(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, NULL, NULL, timeout * GST_SECOND);
+       if (change_ret == GST_STATE_CHANGE_SUCCESS || change_ret == GST_STATE_CHANGE_NO_PREROLL)
        {
-               MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_READY );
+               MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_READY);
        }
        else
        {
@@ -8124,7 +8124,7 @@ static int __gst_stop(mm_player_t* player) // @
        }
 
        /* generate dot file if enabled */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-stop" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-stop");
 
        MMPLAYER_FLEAVE();
 
@@ -8152,9 +8152,9 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
 
        player->ignore_asyncdone = FALSE;
 
-       if ( FALSE == async )
+       if (FALSE == async)
        {
-               if ( ret != MM_ERROR_NONE )
+               if (ret != MM_ERROR_NONE)
                {
                        GstMessage *msg = NULL;
                        GTimer *timer = NULL;
@@ -8165,7 +8165,7 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
                        timer = g_timer_new();
                        g_timer_start(timer);
 
-                       GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
+                       GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
                        gboolean got_msg = FALSE;
                        /* check if gst error posted or not */
                        do
@@ -8180,12 +8180,12 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
                                                /* parse error code */
                                                gst_message_parse_error(msg, &error, NULL);
 
-                                               if ( gst_structure_has_name ( gst_message_get_structure(msg), "streaming_error" ) )
+                                               if (gst_structure_has_name(gst_message_get_structure(msg), "streaming_error"))
                                                {
                                                        /* Note : the streaming error from the streaming source is handled
                                                         *   using __mmplayer_handle_streaming_error.
                                                         */
-                                                       __mmplayer_handle_streaming_error ( player, msg );
+                                                       __mmplayer_handle_streaming_error(player, msg);
 
                                                }
                                                else if (error)
@@ -8194,19 +8194,19 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
 
                                                        if (error->domain == GST_STREAM_ERROR)
                                                        {
-                                                               ret = __gst_handle_stream_error( player, error, msg );
+                                                               ret = __gst_handle_stream_error(player, error, msg);
                                                        }
                                                        else if (error->domain == GST_RESOURCE_ERROR)
                                                        {
-                                                               ret = __gst_handle_resource_error( player, error->code );
+                                                               ret = __gst_handle_resource_error(player, error->code);
                                                        }
                                                        else if (error->domain == GST_LIBRARY_ERROR)
                                                        {
-                                                               ret = __gst_handle_library_error( player, error->code );
+                                                               ret = __gst_handle_library_error(player, error->code);
                                                        }
                                                        else if (error->domain == GST_CORE_ERROR)
                                                        {
-                                                               ret = __gst_handle_core_error( player, error->code );
+                                                               ret = __gst_handle_core_error(player, error->code);
                                                        }
                                                }
 
@@ -8218,25 +8218,25 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
                        } while (!got_msg && (g_timer_elapsed(timer, NULL) < MAX_TIMEOUT_SEC));
                        /* clean */
                        gst_object_unref(bus);
-                       g_timer_stop (timer);
-                       g_timer_destroy (timer);
+                       g_timer_stop(timer);
+                       g_timer_destroy(timer);
 
                        return ret;
                }
-               else if ( !player->video_stream_cb && (!player->pipeline->videobin) && (!player->pipeline->audiobin) )
+               else if (!player->video_stream_cb && (!player->pipeline->videobin) && (!player->pipeline->audiobin))
                {
                        if (MMPLAYER_IS_RTSP_STREAMING(player))
                                return ret;
                        return MM_ERROR_PLAYER_CODEC_NOT_FOUND;
                }
-               else if ( ret== MM_ERROR_NONE)
+               else if (ret== MM_ERROR_NONE)
                {
-                       MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_PAUSED );
+                       MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PAUSED);
                }
        }
 
        /* generate dot file before returning error */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-pause" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-pause");
 
        MMPLAYER_FLEAVE();
 
@@ -8258,16 +8258,16 @@ int __gst_resume(mm_player_t* player, gboolean async) // @
        MMPLAYER_PRINT_STATE(player);
 
        /* generate dot file before returning error */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-resume" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-resume");
 
-       if ( async )
+       if (async)
                LOGD("do async state transition to PLAYING.\n");
 
        /* set pipeline state to PLAYING */
        timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player);
 
        ret = __mmplayer_gst_set_state(player,
-               player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, timeout );
+               player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PLAYING, async, timeout);
        if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to set state to PLAYING\n");
@@ -8277,14 +8277,14 @@ int __gst_resume(mm_player_t* player, gboolean async) // @
        {
                if (async == FALSE)
                {
-                       // MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_PLAYING );
+                       // MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PLAYING);
                        LOGD("update state machine to %d\n", MM_PLAYER_STATE_PLAYING);
                        ret = __mmplayer_set_state(player, MM_PLAYER_STATE_PLAYING);
                }
        }
 
        /* generate dot file before returning error */
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-resume" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-resume");
 
        MMPLAYER_FLEAVE();
 
@@ -8302,29 +8302,29 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
        GstSeekFlags seek_flags = GST_SEEK_FLAG_FLUSH;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( !MMPLAYER_IS_LIVE_STREAMING(player), MM_ERROR_PLAYER_NO_OP );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(!MMPLAYER_IS_LIVE_STREAMING(player), MM_ERROR_PLAYER_NO_OP);
 
-       if ( MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING
-               && MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED )
+       if (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING
+               && MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED)
                goto PENDING;
 
-       if( !MMPLAYER_IS_MS_BUFF_SRC(player) )
+       if (!MMPLAYER_IS_MS_BUFF_SRC(player))
        {
                /* check duration */
                /* NOTE : duration cannot be zero except live streaming.
                 *              Since some element could have some timing problemn with quering duration, try again.
                 */
-               if ( !player->duration )
+               if (!player->duration)
                {
-                       if ( !gst_element_query_duration( player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec ))
+                       if (!gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec))
                        {
                                goto SEEK_ERROR;
                        }
                        player->duration = dur_nsec;
                }
 
-               if ( player->duration )
+               if (player->duration)
                {
                        dur_msec = GST_TIME_AS_MSECONDS(player->duration);
                }
@@ -8347,26 +8347,26 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
        }
 
        /* do seek */
-       switch ( format )
+       switch (format)
        {
                case MM_PLAYER_POS_FORMAT_TIME:
                {
-                       if( !MMPLAYER_IS_MS_BUFF_SRC(player) )
+                       if (!MMPLAYER_IS_MS_BUFF_SRC(player))
                        {
                                /* check position is valid or not */
-                               if ( position > dur_msec )
+                               if (position > dur_msec)
                                        goto INVALID_ARGS;
 
-                               LOGD("seeking to (%lu) msec, duration is %d msec\n", position, dur_msec);
+                               LOGD("seeking to(%lu) msec, duration is %d msec\n", position, dur_msec);
 
-                               if ( player->doing_seek )
+                               if (player->doing_seek)
                                {
                                        LOGD("not completed seek");
                                        return MM_ERROR_PLAYER_DOING_SEEK;
                                }
                        }
 
-                       if ( !internal_called )
+                       if (!internal_called)
                                player->doing_seek = TRUE;
 
                        pos_nsec = position * G_GINT64_CONSTANT(1000000);
@@ -8379,22 +8379,22 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
                                gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &cur_time);
 
                                /* flush */
-                               GstEvent *event = gst_event_new_seek (1.0,
+                               GstEvent *event = gst_event_new_seek(1.0,
                                                                GST_FORMAT_TIME,
                                                                (GstSeekFlags)GST_SEEK_FLAG_FLUSH,
                                                                GST_SEEK_TYPE_SET, cur_time,
                                                                GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
-                               if(event) {
+                               if (event) {
                                        __gst_send_event_to_sink(player, event);
                                }
 
-                               __gst_pause( player, FALSE );
+                               __gst_pause(player, FALSE);
                        }
 
-                       ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
+                       ret = __gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                                        GST_FORMAT_TIME, seek_flags,
-                                                       GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
-                       if ( !ret  )
+                                                       GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
+                       if (!ret )
                        {
                                LOGE("failed to set position. dur[%lu]  pos[%lu]  pos_msec[%llu]\n", dur_msec, position, pos_nsec);
                                goto SEEK_ERROR;
@@ -8404,7 +8404,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
 
                case MM_PLAYER_POS_FORMAT_PERCENT:
                {
-                       LOGD("seeking to (%lu)%% \n", position);
+                       LOGD("seeking to(%lu)%% \n", position);
 
                        if (player->doing_seek)
                        {
@@ -8412,15 +8412,15 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
                                return MM_ERROR_PLAYER_DOING_SEEK;
                        }
 
-                       if ( !internal_called)
+                       if (!internal_called)
                                player->doing_seek = TRUE;
 
                        /* FIXIT : why don't we use 'GST_FORMAT_PERCENT' */
-                       pos_nsec = (gint64) ( ( position * player->duration ) / 100 );
-                       ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
+                       pos_nsec = (gint64)((position * player->duration) / 100);
+                       ret = __gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, player->playback_rate,
                                                        GST_FORMAT_TIME, seek_flags,
-                                                       GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
-                       if ( !ret  )
+                                                       GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
+                       if (!ret )
                        {
                                LOGE("failed to set position. dur[%lud]  pos[%lud]  pos_msec[%"G_GUINT64_FORMAT"]\n", dur_msec, position, pos_nsec);
                                goto SEEK_ERROR;
@@ -8434,13 +8434,13 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
        }
 
        /* NOTE : store last seeking point to overcome some bad operation
-         *      ( returning zero when getting current position ) of some elements
+         *     (returning zero when getting current position) of some elements
          */
        player->last_position = pos_nsec;
 
        /* MSL should guarante playback rate when seek is selected during trick play of fast forward. */
-       if ( player->playback_rate > 1.0 )
-               _mmplayer_set_playspeed ((MMHandleType)player, player->playback_rate, FALSE);
+       if (player->playback_rate > 1.0)
+               _mmplayer_set_playspeed((MMHandleType)player, player->playback_rate, FALSE);
 
        MMPLAYER_FLEAVE();
        return MM_ERROR_NONE;
@@ -8473,30 +8473,30 @@ __gst_get_position(mm_player_t* player, int format, unsigned long* position) //
        gint64 pos_msec = 0;
        gboolean ret = TRUE;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player && position && player->pipeline && player->pipeline->mainbin,
-               MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && position && player->pipeline && player->pipeline->mainbin,
+               MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        current_state = MMPLAYER_CURRENT_STATE(player);
 
        /* NOTE : query position except paused state to overcome some bad operation
         * please refer to below comments in details
         */
-       if ( current_state != MM_PLAYER_STATE_PAUSED )
+       if (current_state != MM_PLAYER_STATE_PAUSED)
        {
                ret = gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_msec);
        }
 
        /* NOTE : get last point to overcome some bad operation of some elements
-        * ( returning zero when getting current position in paused state
+        *(returning zero when getting current position in paused state
         * and when failed to get postion during seeking
         */
-       if ( ( current_state == MM_PLAYER_STATE_PAUSED )
-               || ( ! ret ))
-               //|| ( player->last_position != 0 && pos_msec == 0 ) )
+       if ((current_state == MM_PLAYER_STATE_PAUSED)
+               || (!ret))
+               //|| (player->last_position != 0 && pos_msec == 0))
        {
-               LOGD ("pos_msec = %"GST_TIME_FORMAT" and ret = %d and state = %d", GST_TIME_ARGS (pos_msec), ret, current_state);
+               LOGD("pos_msec = %"GST_TIME_FORMAT" and ret = %d and state = %d", GST_TIME_ARGS(pos_msec), ret, current_state);
 
-               if(player->playback_rate < 0.0)
+               if (player->playback_rate < 0.0)
                        pos_msec = player->last_position - TRICKPLAY_OFFSET;
                else
                        pos_msec = player->last_position;
@@ -8537,7 +8537,7 @@ __gst_get_position(mm_player_t* player, int format, unsigned long* position) //
                        dur = player->duration / GST_SECOND;
                        if (dur <= 0)
                        {
-                               LOGD ("duration is [%d], so returning position 0\n",dur);
+                               LOGD("duration is [%d], so returning position 0\n",dur);
                                *position = 0;
                        }
                        else
@@ -8560,7 +8560,7 @@ static int        __gst_get_buffer_position(mm_player_t* player, int format, unsigned
 #define STREAMING_IS_FINISHED  0
 #define BUFFERING_MAX_PER      100
 #define DEFAULT_PER_VALUE      -1
-#define CHECK_PERCENT_VALUE(a,min,max) (((a)>(min))?(((a)<(max))?(a):(max)):(min))
+#define CHECK_PERCENT_VALUE(a,min,max)(((a)>(min))?(((a)<(max))?(a):(max)):(min))
 
        MMPlayerGstElement *mainbin = NULL;
        gint start_per = DEFAULT_PER_VALUE, stop_per = DEFAULT_PER_VALUE;
@@ -8571,46 +8571,46 @@ static int      __gst_get_buffer_position(mm_player_t* player, int format, unsigned
        gint64 content_size_time = player->duration;
        guint64 content_size_bytes = player->http_content_size;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player &&
+       MMPLAYER_RETURN_VAL_IF_FAIL(player &&
                                                player->pipeline &&
                                                player->pipeline->mainbin,
-                                               MM_ERROR_PLAYER_NOT_INITIALIZED );
+                                               MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( start_pos && stop_pos, MM_ERROR_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && stop_pos, MM_ERROR_INVALID_ARGUMENT);
 
        *start_pos = 0;
        *stop_pos = 0;
 
-       if (!MMPLAYER_IS_HTTP_STREAMING ( player ))
+       if (!MMPLAYER_IS_HTTP_STREAMING(player))
        {
                /* and rtsp is not ready yet. */
-               LOGW ("it's only used for http streaming case.\n");
+               LOGW("it's only used for http streaming case.\n");
                return MM_ERROR_PLAYER_NO_OP;
        }
 
        if (format != MM_PLAYER_POS_FORMAT_PERCENT)
        {
-               LOGW ("Time format is not supported yet.\n");
+               LOGW("Time format is not supported yet.\n");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if (content_size_time <= 0 || content_size_bytes <= 0)
        {
-               LOGW ("there is no content size.");
+               LOGW("there is no content size.");
                return MM_ERROR_NONE;
        }
 
-       if (__gst_get_position (player, MM_PLAYER_POS_FORMAT_TIME, &position) != MM_ERROR_NONE)
+       if (__gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, &position) != MM_ERROR_NONE)
        {
-               LOGW ("fail to get current position.");
+               LOGW("fail to get current position.");
                return MM_ERROR_NONE;
        }
 
-       LOGD ("pos %d ms, dur %d sec, len %"G_GUINT64_FORMAT" bytes",
+       LOGD("pos %d ms, dur %d sec, len %"G_GUINT64_FORMAT" bytes",
                position, (guint)(content_size_time/GST_SECOND), content_size_bytes);
 
        mainbin = player->pipeline->mainbin;
-       start_per = ceil(100 * (position*GST_MSECOND) / content_size_time);
+       start_per = ceil(100 *(position*GST_MSECOND) / content_size_time);
 
        if (mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst)
        {
@@ -8618,24 +8618,24 @@ static int      __gst_get_buffer_position(mm_player_t* player, int format, unsigned
                gint byte_in_rate = 0, byte_out_rate = 0;
                gint64 estimated_total = 0;
 
-               query = gst_query_new_buffering ( GST_FORMAT_BYTES );
+               query = gst_query_new_buffering(GST_FORMAT_BYTES);
                if (!query || !gst_element_query(mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst, query))
                {
-                       LOGW ("fail to get buffering query from queue2");
+                       LOGW("fail to get buffering query from queue2");
                        if (query)
-                               gst_query_unref (query);
+                               gst_query_unref(query);
                        return MM_ERROR_NONE;
                }
 
                gst_query_parse_buffering_stats(query, &mode, &byte_in_rate, &byte_out_rate, NULL);
-               LOGD ("mode %d, in_rate %d, out_rate %d", mode, byte_in_rate, byte_out_rate);
+               LOGD("mode %d, in_rate %d, out_rate %d", mode, byte_in_rate, byte_out_rate);
 
-               if (mode == GST_BUFFERING_STREAM) /* using only queue in case of push mode (ts / mp3) */
+               if (mode == GST_BUFFERING_STREAM) /* using only queue in case of push mode(ts / mp3) */
                {
                        if (gst_element_query_position(mainbin[MMPLAYER_M_SRC].gst,
                                GST_FORMAT_BYTES, &buffered_total))
                        {
-                               LOGD ("buffered_total %"G_GINT64_FORMAT, buffered_total);
+                               LOGD("buffered_total %"G_GINT64_FORMAT, buffered_total);
                                stop_per = 100 * buffered_total / content_size_bytes;
                        }
                }
@@ -8650,10 +8650,10 @@ static int      __gst_get_buffer_position(mm_player_t* player, int format, unsigned
                        {
                                /* buffered size info from queue2 */
                                num_of_ranges = gst_query_get_n_buffering_ranges(query);
-                               for ( idx=0 ; idx<num_of_ranges ; idx++ )
+                               for (idx=0 ; idx<num_of_ranges ; idx++)
                                {
-                                       gst_query_parse_nth_buffering_range (query, idx, &start_byte, &stop_byte);
-                                       LOGD ("range %d, %"G_GINT64_FORMAT" ~ %"G_GUINT64_FORMAT, idx, start_byte, stop_byte);
+                                       gst_query_parse_nth_buffering_range(query, idx, &start_byte, &stop_byte);
+                                       LOGD("range %d, %"G_GINT64_FORMAT" ~ %"G_GUINT64_FORMAT, idx, start_byte, stop_byte);
 
                                        buffered_total += (stop_byte - start_byte);
                                }
@@ -8663,7 +8663,7 @@ static int        __gst_get_buffer_position(mm_player_t* player, int format, unsigned
                                stop_per = BUFFERING_MAX_PER;
                        }
                }
-               gst_query_unref (query);
+               gst_query_unref(query);
        }
 
        if (stop_per == DEFAULT_PER_VALUE)
@@ -8679,7 +8679,7 @@ static int        __gst_get_buffer_position(mm_player_t* player, int format, unsigned
                                guint curr_size_bytes = 0;
                                g_object_get(G_OBJECT(mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].gst),
                                        "curr-size-bytes", &curr_size_bytes, NULL);
-                               LOGD ("curr_size_bytes of multiqueue = %d", curr_size_bytes);
+                               LOGD("curr_size_bytes of multiqueue = %d", curr_size_bytes);
                                buffered_total += curr_size_bytes;
                        }
 
@@ -8691,14 +8691,14 @@ static int      __gst_get_buffer_position(mm_player_t* player, int format, unsigned
                                buffered_sec = (gint)(ceil((gdouble)GET_BIT_FROM_BYTE(buffered_total)/(gdouble)player->total_bitrate));
 
                        if (buffered_sec >= 0)
-                               stop_per = start_per + (gint)(ceil)(100*(gdouble)buffered_sec/(gdouble)dur_sec);
+                               stop_per = start_per +(gint)(ceil)(100*(gdouble)buffered_sec/(gdouble)dur_sec);
                }
        }
 
        *start_pos = CHECK_PERCENT_VALUE(start_per, 0, 100);
        *stop_pos = CHECK_PERCENT_VALUE(stop_per, *start_pos, 100);
 
-       LOGD ("buffered info: %"G_GINT64_FORMAT" bytes, %d sec, per %lu~%lu\n",
+       LOGD("buffered info: %"G_GINT64_FORMAT" bytes, %d sec, per %lu~%lu\n",
                buffered_total, buffered_sec, *start_pos, *stop_pos);
 
        return MM_ERROR_NONE;
@@ -8709,7 +8709,7 @@ __gst_set_message_callback(mm_player_t* player, MMMessageCallback callback, gpoi
 {
        MMPLAYER_FENTER();
 
-       if ( !player )
+       if (!player)
        {
                LOGW("set_message_callback is called with invalid player handle\n");
                return MM_ERROR_PLAYER_NOT_INITIALIZED;
@@ -8732,9 +8732,9 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( uri , FALSE);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( data , FALSE);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( ( strlen(uri) <= MM_MAX_URL_LEN ), FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(uri , FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(data , FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL((strlen(uri) <= MM_MAX_URL_LEN), FALSE);
 
        memset(data, 0, sizeof(MMPlayerParseProfile));
 
@@ -8755,7 +8755,7 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
        else if ((path = strstr(uri, "rtsp://")))
        {
                if (strlen(path)) {
-                       if((path = strstr(uri, "/wfd1.0/"))) {
+                       if ((path = strstr(uri, "/wfd1.0/"))) {
                                strncpy(data->uri, uri, MM_MAX_URL_LEN-1);
                                data->uri_type = MM_PLAYER_URI_TYPE_URL_WFD;
                                ret = MM_ERROR_NONE;
@@ -8773,8 +8773,8 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
                if (strlen(path)) {
                        strncpy(data->uri, uri, MM_MAX_URL_LEN-1);
 
-                       if (g_str_has_suffix (g_ascii_strdown(uri, strlen(uri)), ".ism/manifest") ||
-                               g_str_has_suffix (g_ascii_strdown(uri, strlen(uri)), ".isml/manifest"))
+                       if (g_str_has_suffix(g_ascii_strdown(uri, strlen(uri)), ".ism/manifest") ||
+                               g_str_has_suffix(g_ascii_strdown(uri, strlen(uri)), ".isml/manifest"))
                        {
                                data->uri_type = MM_PLAYER_URI_TYPE_SS;
                        }
@@ -8789,8 +8789,8 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
                if (strlen(path)) {
                        strncpy(data->uri, uri, MM_MAX_URL_LEN-1);
 
-               if (g_str_has_suffix (g_ascii_strdown(uri, strlen(uri)), ".ism/manifest") ||
-                               g_str_has_suffix (g_ascii_strdown(uri, strlen(uri)), ".isml/manifest"))
+               if (g_str_has_suffix(g_ascii_strdown(uri, strlen(uri)), ".ism/manifest") ||
+                               g_str_has_suffix(g_ascii_strdown(uri, strlen(uri)), ".isml/manifest"))
                        {
                                data->uri_type = MM_PLAYER_URI_TYPE_SS;
                        }
@@ -8874,7 +8874,7 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
                        }
 
                        LOGD("ext: %s, mem_size: %d, mmap(param): %p\n", ext, mem_size, param);
-                       if ( mem_size && param)
+                       if (mem_size && param)
                        {
                                data->mem = param;
                                data->mem_size = mem_size;
@@ -8890,20 +8890,20 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
 
                if ((path = strstr(uri, "file://"))) {
 
-                       location = g_filename_from_uri (uri, NULL, &err);
+                       location = g_filename_from_uri(uri, NULL, &err);
 
                        if (!location || (err != NULL)) {
-                         LOGE ("Invalid URI '%s' for filesrc: %s", path,
-                                 (err != NULL) ? err->message : "unknown error");
+                         LOGE("Invalid URI '%s' for filesrc: %s", path,
+                                (err != NULL) ? err->message : "unknown error");
 
-                         if (err) g_error_free (err);
-                         if (location) g_free (location);
+                         if (err) g_error_free(err);
+                         if (location) g_free(location);
 
                          data->uri_type = MM_PLAYER_URI_TYPE_NONE;
                          goto exit;
                        }
 
-                       LOGD ("path from uri: %s", location);
+                       LOGD("path from uri: %s", location);
                }
 
                path = (location != NULL)?(location):((char*)uri);
@@ -8933,11 +8933,11 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
                }
                else
                {
-                       LOGE ("invalid uri, could not play..\n");
+                       LOGE("invalid uri, could not play..\n");
                        data->uri_type = MM_PLAYER_URI_TYPE_NONE;
                }
 
-               if (location) g_free (location);
+               if (location) g_free(location);
        }
 
 exit:
@@ -8963,7 +8963,7 @@ gboolean _asm_postmsg(gpointer *data)
        MMMessageParamType msg = {0, };
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
        LOGW("get notified");
 
        if ((player->cmd == MMPLAYER_COMMAND_DESTROY) ||
@@ -8977,7 +8977,7 @@ gboolean _asm_postmsg(gpointer *data)
        msg.union_type = MM_MSG_UNION_CODE;
        msg.code = player->sound_focus.focus_changed_msg;
 
-       MMPLAYER_POST_MSG( player, MM_MESSAGE_READY_TO_RESUME, &msg);
+       MMPLAYER_POST_MSG(player, MM_MESSAGE_READY_TO_RESUME, &msg);
        player->resume_event_id = 0;
 
        LOGW("dispatched");
@@ -8991,20 +8991,20 @@ gboolean _asm_lazy_pause(gpointer *data)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        if (MMPLAYER_CURRENT_STATE(player) == MM_PLAYER_STATE_PLAYING)
        {
-               LOGD ("Ready to proceed lazy pause\n");
+               LOGD("Ready to proceed lazy pause\n");
                ret = _mmplayer_pause((MMHandleType)player);
-               if(MM_ERROR_NONE != ret)
+               if (MM_ERROR_NONE != ret)
                {
                        LOGE("MMPlayer pause failed in ASM callback lazy pause\n");
                }
        }
        else
        {
-               LOGD ("Invalid state to proceed lazy pause\n");
+               LOGD("Invalid state to proceed lazy pause\n");
        }
 
        /* unset mute */
@@ -9037,7 +9037,7 @@ __mmplayer_can_do_interrupt(mm_player_t *player)
        if (player->doing_seek)
        {
                MMMessageParamType msg_param;
-               memset (&msg_param, 0, sizeof(MMMessageParamType));
+               memset(&msg_param, 0, sizeof(MMMessageParamType));
                msg_param.code = MM_ERROR_PLAYER_SEEK;
                player->doing_seek = FALSE;
                MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
@@ -9168,7 +9168,7 @@ void __mmplayer_sound_focus_watch_callback(int id, mm_sound_focus_type_e focus_t
                        if (!MMPLAYER_IS_RTSP_STREAMING(player))
                        {
                                // hold 0.7 second to excute "fadedown mute" effect
-                               LOGW ("do fade down->pause->undo fade down");
+                               LOGW("do fade down->pause->undo fade down");
 
                                __mmplayer_do_sound_fadedown(player, MM_PLAYER_FADEOUT_TIME_DEFAULT);
 
@@ -9188,7 +9188,7 @@ void __mmplayer_sound_focus_watch_callback(int id, mm_sound_focus_type_e focus_t
                }
                else
                {
-                       LOGW ("pause immediately");
+                       LOGW("pause immediately");
                        result = _mmplayer_pause((MMHandleType)player);
                        if (result != MM_ERROR_NONE)
                        {
@@ -9222,7 +9222,7 @@ DONE:
        player->sound_focus.cb_pending = FALSE;
 
 EXIT:
-       MMPLAYER_CMD_UNLOCK( player );
+       MMPLAYER_CMD_UNLOCK(player);
        LOGW("dispatched");
        return;
 
@@ -9278,7 +9278,7 @@ __mmplayer_sound_focus_callback(int id, mm_sound_focus_type_e focus_type, mm_sou
                        if (!MMPLAYER_IS_RTSP_STREAMING(player))
                        {
                                //hold 0.7 second to excute "fadedown mute" effect
-                               LOGW ("do fade down->pause->undo fade down");
+                               LOGW("do fade down->pause->undo fade down");
 
                                __mmplayer_do_sound_fadedown(player, MM_PLAYER_FADEOUT_TIME_DEFAULT);
 
@@ -9298,7 +9298,7 @@ __mmplayer_sound_focus_callback(int id, mm_sound_focus_type_e focus_type, mm_sou
                }
                else
                {
-                       LOGW ("pause immediately");
+                       LOGW("pause immediately");
                        result = _mmplayer_pause((MMHandleType)player);
                        if (result != MM_ERROR_NONE)
                        {
@@ -9328,14 +9328,14 @@ __mmplayer_sound_focus_callback(int id, mm_sound_focus_type_e focus_type, mm_sou
        }
 
 DONE:
-       if ( !lazy_pause )
+       if (!lazy_pause)
        {
                player->sound_focus.by_asm_cb = FALSE;
        }
        player->sound_focus.cb_pending = FALSE;
 
 EXIT:
-       MMPLAYER_CMD_UNLOCK( player );
+       MMPLAYER_CMD_UNLOCK(player);
        LOGW("dispatched");
        return;
 
@@ -9353,7 +9353,7 @@ _mmplayer_create_player(MMHandleType handle) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* initialize player state */
        MMPLAYER_CURRENT_STATE(player) = MM_PLAYER_STATE_NONE;
@@ -9362,19 +9362,19 @@ _mmplayer_create_player(MMHandleType handle) // @
        MMPLAYER_TARGET_STATE(player) = MM_PLAYER_STATE_NONE;
 
        /* check current state */
-       MMPLAYER_CHECK_STATE ( player, MMPLAYER_COMMAND_CREATE );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_CREATE);
 
        /* construct attributes */
        player->attrs = _mmplayer_construct_attribute(handle);
 
-       if ( !player->attrs )
+       if (!player->attrs)
        {
                LOGE("Failed to construct attributes\n");
                return ret;
        }
 
        /* initialize gstreamer with configured parameter */
-       if ( ! __mmplayer_init_gstreamer(player) )
+       if (!__mmplayer_init_gstreamer(player))
        {
                LOGE("Initializing gstreamer failed\n");
                _mmplayer_deconstruct_attribute(handle);
@@ -9382,7 +9382,7 @@ _mmplayer_create_player(MMHandleType handle) // @
        }
 
        /* initialize factories if not using decodebin */
-       if( player->factories == NULL )
+       if (player->factories == NULL)
                __mmplayer_init_factories(player);
 
        /* create lock. note that g_tread_init() has already called in gst_init() */
@@ -9396,7 +9396,7 @@ _mmplayer_create_player(MMHandleType handle) // @
 
        /* create repeat thread */
        player->repeat_thread =
-               g_thread_try_new ("repeat_thread", __mmplayer_repeat_thread, (gpointer)player, NULL);
+               g_thread_try_new("repeat_thread", __mmplayer_repeat_thread, (gpointer)player, NULL);
        if (!player->repeat_thread)
        {
                LOGE("failed to create repeat_thread(%s)");
@@ -9414,7 +9414,7 @@ _mmplayer_create_player(MMHandleType handle) // @
 
        /* create next play thread */
        player->next_play_thread =
-               g_thread_try_new ("next_play_thread", __mmplayer_next_play_thread, (gpointer)player, NULL);
+               g_thread_try_new("next_play_thread", __mmplayer_next_play_thread, (gpointer)player, NULL);
        if (!player->next_play_thread)
        {
                LOGE("failed to create next play thread");
@@ -9432,7 +9432,7 @@ _mmplayer_create_player(MMHandleType handle) // @
        }
 
        /* initialize resource manager */
-       if ( MM_ERROR_NONE != _mmplayer_resource_manager_init(&player->resource_manager, player))
+       if (MM_ERROR_NONE != _mmplayer_resource_manager_init(&player->resource_manager, player))
        {
                LOGE("failed to initialize resource manager\n");
                goto ERROR;
@@ -9477,21 +9477,21 @@ _mmplayer_create_player(MMHandleType handle) // @
 
        /* set player state to null */
        MMPLAYER_STATE_CHANGE_TIMEOUT(player) = player->ini.localplayback_state_change_timeout;
-       MMPLAYER_SET_STATE ( player, MM_PLAYER_STATE_NULL );
+       MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_NULL);
 
        return MM_ERROR_NONE;
 
 ERROR:
        /* free lock */
-       g_mutex_clear(&player->fsink_lock );
+       g_mutex_clear(&player->fsink_lock);
 
        /* free thread */
-       if ( player->repeat_thread )
+       if (player->repeat_thread)
        {
                player->repeat_thread_exit = TRUE;
-               g_cond_signal( &player->repeat_thread_cond );
+               g_cond_signal(&player->repeat_thread_cond);
 
-               g_thread_join( player->repeat_thread );
+               g_thread_join(player->repeat_thread);
                player->repeat_thread = NULL;
 
                g_mutex_clear(&player->repeat_thread_mutex);
@@ -9531,33 +9531,33 @@ __mmplayer_init_gstreamer(mm_player_t* player) // @
        int i = 0;
        int arg_count = 0;
 
-       if ( initialized )
+       if (initialized)
        {
                LOGD("gstreamer already initialized.\n");
                return TRUE;
        }
 
        /* alloc */
-       argc = malloc( sizeof(int) );
-       argv = malloc( sizeof(gchar*) * max_argc );
-       argv2 = malloc( sizeof(gchar*) * max_argc );
+       argc = malloc(sizeof(int));
+       argv = malloc(sizeof(gchar*) * max_argc);
+       argv2 = malloc(sizeof(gchar*) * max_argc);
 
-       if ( !argc || !argv || !argv2)
+       if (!argc || !argv || !argv2)
                goto ERROR;
 
-       memset( argv, 0, sizeof(gchar*) * max_argc );
-       memset( argv2, 0, sizeof(gchar*) * max_argc );
+       memset(argv, 0, sizeof(gchar*) * max_argc);
+       memset(argv2, 0, sizeof(gchar*) * max_argc);
 
        /* add initial */
        *argc = 1;
-       argv[0] = g_strdup( "mmplayer" );
+       argv[0] = g_strdup("mmplayer");
 
        /* add gst_param */
-       for ( i = 0; i < 5; i++ ) /* FIXIT : num of param is now fixed to 5. make it dynamic */
+       for (i = 0; i < 5; i++) /* FIXIT : num of param is now fixed to 5. make it dynamic */
        {
-               if ( strlen( player->ini.gst_param[i] ) > 0 )
+               if (strlen(player->ini.gst_param[i]) > 0)
                {
-                       argv[*argc] = g_strdup( player->ini.gst_param[i] );
+                       argv[*argc] = g_strdup(player->ini.gst_param[i]);
                        (*argc)++;
                }
        }
@@ -9567,14 +9567,14 @@ __mmplayer_init_gstreamer(mm_player_t* player) // @
        (*argc)++;
 
        /* check disable registry scan */
-       if ( player->ini.skip_rescan )
+       if (player->ini.skip_rescan)
        {
                argv[*argc] = g_strdup("--gst-disable-registry-update");
                (*argc)++;
        }
 
        /* check disable segtrap */
-       if ( player->ini.disable_segtrap )
+       if (player->ini.disable_segtrap)
        {
                argv[*argc] = g_strdup("--gst-disable-segtrap");
                (*argc)++;
@@ -9584,7 +9584,7 @@ __mmplayer_init_gstreamer(mm_player_t* player) // @
        LOGD("argc : %d\n", *argc);
        arg_count = *argc;
 
-       for ( i = 0; i < arg_count; i++ )
+       for (i = 0; i < arg_count; i++)
        {
                argv2[i] = argv[i];
                LOGD("argv[%d] : %s\n", i, argv2[i]);
@@ -9592,26 +9592,26 @@ __mmplayer_init_gstreamer(mm_player_t* player) // @
 
 
        /* initializing gstreamer */
-       if ( ! gst_init_check (argc, &argv, &err))
+       if (!gst_init_check(argc, &argv, &err))
        {
                LOGE("Could not initialize GStreamer: %s\n", err ? err->message : "unknown error occurred");
                if (err)
                {
-                       g_error_free (err);
+                       g_error_free(err);
                }
 
                goto ERROR;
        }
        /* release */
-       for ( i = 0; i < arg_count; i++ )
+       for (i = 0; i < arg_count; i++)
        {
                //LOGD("release - argv[%d] : %s\n", i, argv2[i]);
-               MMPLAYER_FREEIF( argv2[i] );
+               MMPLAYER_FREEIF(argv2[i]);
        }
 
-       MMPLAYER_FREEIF( argv );
-       MMPLAYER_FREEIF( argv2 );
-       MMPLAYER_FREEIF( argc );
+       MMPLAYER_FREEIF(argv);
+       MMPLAYER_FREEIF(argv2);
+       MMPLAYER_FREEIF(argc);
 
        /* done */
        initialized = TRUE;
@@ -9621,15 +9621,15 @@ __mmplayer_init_gstreamer(mm_player_t* player) // @
 ERROR:
 
        /* release */
-       for ( i = 0; i < arg_count; i++ )
+       for (i = 0; i < arg_count; i++)
        {
                LOGD("free[%d] : %s\n", i, argv2[i]);
-               MMPLAYER_FREEIF( argv2[i] );
+               MMPLAYER_FREEIF(argv2[i]);
        }
 
-       MMPLAYER_FREEIF( argv );
-       MMPLAYER_FREEIF( argv2 );
-       MMPLAYER_FREEIF( argc );
+       MMPLAYER_FREEIF(argv);
+       MMPLAYER_FREEIF(argv2);
+       MMPLAYER_FREEIF(argc);
 
        return FALSE;
 }
@@ -9637,7 +9637,7 @@ ERROR:
 int
 __mmplayer_destroy_streaming_ext(mm_player_t* player)
 {
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (player->pd_downloader)
        {
@@ -9662,18 +9662,18 @@ _mmplayer_destroy(MMHandleType handle) // @
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* destroy can called at anytime */
-       MMPLAYER_CHECK_STATE ( player, MMPLAYER_COMMAND_DESTROY );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_DESTROY);
 
        __mmplayer_destroy_streaming_ext(player);
 
        /* release repeat thread */
-       if ( player->repeat_thread )
+       if (player->repeat_thread)
        {
                player->repeat_thread_exit = TRUE;
-               g_cond_signal( &player->repeat_thread_cond );
+               g_cond_signal(&player->repeat_thread_cond);
 
                LOGD("waitting for repeat thread exit\n");
                g_thread_join(player->repeat_thread);
@@ -9683,15 +9683,15 @@ _mmplayer_destroy(MMHandleType handle) // @
        }
 
        /* release next play thread */
-       if ( player->next_play_thread )
+       if (player->next_play_thread)
        {
                player->next_play_thread_exit = TRUE;
-               g_cond_signal( &player->next_play_thread_cond );
+               g_cond_signal(&player->next_play_thread_cond);
 
                LOGD("waitting for next play thread exit\n");
-               g_thread_join ( player->next_play_thread );
-               g_mutex_clear(&player->next_play_thread_mutex );
-               g_cond_clear(&player->next_play_thread_cond );
+               g_thread_join(player->next_play_thread);
+               g_mutex_clear(&player->next_play_thread_mutex);
+               g_cond_clear(&player->next_play_thread_cond);
                LOGD("next play thread released\n");
        }
 
@@ -9711,13 +9711,13 @@ _mmplayer_destroy(MMHandleType handle) // @
        }
 
        /* withdraw asm */
-       if ( MM_ERROR_NONE != _mmplayer_sound_unregister(&player->sound_focus) )
+       if (MM_ERROR_NONE != _mmplayer_sound_unregister(&player->sound_focus))
        {
                LOGE("failed to deregister asm server\n");
        }
 
        /* de-initialize resource manager */
-       if ( MM_ERROR_NONE != _mmplayer_resource_manager_deinit(&player->resource_manager))
+       if (MM_ERROR_NONE != _mmplayer_resource_manager_deinit(&player->resource_manager))
        {
                LOGE("failed to deinitialize resource manager\n");
        }
@@ -9732,18 +9732,18 @@ _mmplayer_destroy(MMHandleType handle) // @
 
        if (player->resume_event_id)
        {
-               g_source_remove (player->resume_event_id);
+               g_source_remove(player->resume_event_id);
                player->resume_event_id = 0;
        }
 
        if (player->resumable_cancel_id)
        {
-               g_source_remove (player->resumable_cancel_id);
+               g_source_remove(player->resumable_cancel_id);
                player->resumable_cancel_id = 0;
        }
 
        /* release pipeline */
-       if ( MM_ERROR_NONE != __mmplayer_gst_destroy_pipeline( player ) )
+       if (MM_ERROR_NONE != __mmplayer_gst_destroy_pipeline(player))
        {
                LOGE("failed to destory pipeline\n");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -9751,24 +9751,24 @@ _mmplayer_destroy(MMHandleType handle) // @
 
        if (player->is_external_subtitle_present && player->subtitle_language_list)
        {
-         g_list_free (player->subtitle_language_list);
+         g_list_free(player->subtitle_language_list);
          player->subtitle_language_list = NULL;
        }
 
-       __mmplayer_release_dump_list (player->dump_list);
+       __mmplayer_release_dump_list(player->dump_list);
 
        /* release miscellaneous information.
           these info needs to be released after pipeline is destroyed. */
-       __mmplayer_release_misc_post( player );
+       __mmplayer_release_misc_post(player);
 
        /* release attributes */
-       _mmplayer_deconstruct_attribute( handle );
+       _mmplayer_deconstruct_attribute(handle);
 
        /* release factories */
-       __mmplayer_release_factories( player );
+       __mmplayer_release_factories(player);
 
        /* release lock */
-       g_mutex_clear(&player->fsink_lock );
+       g_mutex_clear(&player->fsink_lock);
 
        /* release video bo lock and cond */
        g_mutex_clear(&player->video_bo_mutex);
@@ -9785,16 +9785,16 @@ __mmplayer_realize_streaming_ext(mm_player_t* player)
        int ret = MM_ERROR_NONE;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (MMPLAYER_IS_HTTP_PD(player))
        {
                gboolean bret = FALSE;
 
                player->pd_downloader = _mmplayer_create_pd_downloader();
-               if ( !player->pd_downloader )
+               if (!player->pd_downloader)
                {
-                       LOGE ("Unable to create PD Downloader...");
+                       LOGE("Unable to create PD Downloader...");
                        ret = MM_ERROR_PLAYER_NO_FREE_SPACE;
                }
 
@@ -9802,7 +9802,7 @@ __mmplayer_realize_streaming_ext(mm_player_t* player)
 
                if (FALSE == bret)
                {
-                       LOGE ("Unable to create PD Downloader...");
+                       LOGE("Unable to create PD Downloader...");
                        ret = MM_ERROR_PLAYER_NOT_INITIALIZED;
                }
        }
@@ -9814,12 +9814,12 @@ __mmplayer_realize_streaming_ext(mm_player_t* player)
 int
 _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid) // @
 {
-       mm_player_t* player =  (mm_player_t*)hplayer;
+       mm_player_t* player = (mm_player_t*)hplayer;
        MMHandleType attrs = 0;
        int ret = MM_ERROR_NONE;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("fail to get attributes.\n");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -9828,10 +9828,10 @@ _mmplayer_sound_register_with_pid(MMHandleType hplayer, int pid) // @
        player->sound_focus.pid = pid;
 
        /* register to asm */
-       if ( MM_ERROR_NONE != _mmplayer_sound_register(&player->sound_focus,
+       if (MM_ERROR_NONE != _mmplayer_sound_register(&player->sound_focus,
                                                (mm_sound_focus_changed_cb)__mmplayer_sound_focus_callback,
                                                (mm_sound_focus_changed_watch_cb)__mmplayer_sound_focus_watch_callback,
-                                               (void*)player) )
+                                               (void*)player))
 
        {
                /* NOTE : we are dealing it as an error since we cannot expect it's behavior */
@@ -9848,7 +9848,7 @@ _mmplayer_get_client_pid(MMHandleType hplayer, int* pid)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        *pid = player->sound_focus.pid;
 
@@ -9862,7 +9862,7 @@ _mmplayer_get_client_pid(MMHandleType hplayer, int* pid)
 int
 _mmplayer_realize(MMHandleType hplayer) // @
 {
-       mm_player_t* player =  (mm_player_t*)hplayer;
+       mm_player_t* player = (mm_player_t*)hplayer;
        char *uri =NULL;
        void *param = NULL;
        gboolean update_registry = FALSE;
@@ -9872,13 +9872,13 @@ _mmplayer_realize(MMHandleType hplayer) // @
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED )
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED)
 
        /* check current state */
-       MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_REALIZE );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_REALIZE);
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("fail to get attributes.\n");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -9941,19 +9941,19 @@ _mmplayer_realize(MMHandleType hplayer) // @
        /* registry should be updated for downloadable codec */
        mm_attrs_get_int_by_name(attrs, "profile_update_registry", &update_registry);
 
-       if ( update_registry )
+       if (update_registry)
        {
                LOGD("updating registry...\n");
                gst_update_registry();
 
                /* then we have to rebuild factories */
-               __mmplayer_release_factories( player );
+               __mmplayer_release_factories(player);
                __mmplayer_init_factories(player);
        }
 
        /* realize pipeline */
-       ret = __gst_realize( player );
-       if ( ret != MM_ERROR_NONE )
+       ret = __gst_realize(player);
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("fail to realize the player.\n");
        }
@@ -9971,12 +9971,12 @@ int
 __mmplayer_unrealize_streaming_ext(mm_player_t *player)
 {
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* destroy can called at anytime */
        if (player->pd_downloader && MMPLAYER_IS_HTTP_PD(player))
        {
-               _mmplayer_unrealize_pd_downloader ((MMHandleType)player);
+               _mmplayer_unrealize_pd_downloader((MMHandleType)player);
                MMPLAYER_FREEIF(player->pd_downloader);
        }
 
@@ -9993,21 +9993,21 @@ _mmplayer_unrealize(MMHandleType hplayer)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED )
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED)
 
        /* check current state */
-       MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_UNREALIZE );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_UNREALIZE);
 
        __mmplayer_unrealize_streaming_ext(player);
 
        /* unrealize pipeline */
-       ret = __gst_unrealize( player );
+       ret = __gst_unrealize(player);
 
        /* set asm stop if success */
        if (MM_ERROR_NONE == ret)
        {
                ret = _mmplayer_sound_release_focus(&player->sound_focus);
-               if ( ret != MM_ERROR_NONE )
+               if (ret != MM_ERROR_NONE)
                {
                        LOGE("failed to release sound focus, ret(0x%x)\n", ret);
                }
@@ -10078,16 +10078,16 @@ _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        LOGD("volume [L]=%f:[R]=%f\n",
                volume.level[MM_VOLUME_CHANNEL_LEFT], volume.level[MM_VOLUME_CHANNEL_RIGHT]);
 
        /* invalid factor range or not */
-       for ( i = 0; i < MM_VOLUME_CHANNEL_NUM; i++ )
+       for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
        {
                if (volume.level[i] < MM_VOLUME_FACTOR_MIN || volume.level[i] > MM_VOLUME_FACTOR_MAX) {
-                       LOGE("Invalid factor! (valid factor:0~1.0)\n");
+                       LOGE("Invalid factor!(valid factor:0~1.0)\n");
                        return MM_ERROR_INVALID_ARGUMENT;
                }
        }
@@ -10100,7 +10100,7 @@ _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume) // @
        player->sound.volume = volume.level[MM_VOLUME_CHANNEL_LEFT];
 
        /* check pipeline handle */
-       if ( ! player->pipeline || ! player->pipeline->audiobin )
+       if (!player->pipeline || !player->pipeline->audiobin)
        {
                LOGD("audiobin is not created yet\n");
                LOGD("but, current stored volume will be set when it's created.\n");
@@ -10115,7 +10115,7 @@ _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume) // @
        /* setting volume to volume element */
        vol_element = player->pipeline->audiobin[MMPLAYER_A_VOL].gst;
 
-       if ( vol_element )
+       if (vol_element)
        {
                LOGD("volume is set [%f]\n", player->sound.volume);
                g_object_set(vol_element, "volume", player->sound.volume, NULL);
@@ -10135,8 +10135,8 @@ _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType* volume)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL( volume, MM_ERROR_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(volume, MM_ERROR_INVALID_ARGUMENT);
 
        /* returning stored volume */
        for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
@@ -10157,10 +10157,10 @@ _mmplayer_set_mute(MMHandleType hplayer, int mute) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* mute value shoud 0 or 1 */
-       if ( mute != 0 && mute != 1 )
+       if (mute != 0 && mute != 1)
        {
                LOGE("bad mute value\n");
 
@@ -10171,7 +10171,7 @@ _mmplayer_set_mute(MMHandleType hplayer, int mute) // @
        player->sound.mute = mute;
 
        /* just hold mute value if pipeline is not ready */
-       if ( !player->pipeline || !player->pipeline->audiobin )
+       if (!player->pipeline || !player->pipeline->audiobin)
        {
                LOGD("pipeline is not ready. holding mute value\n");
                return MM_ERROR_NONE;
@@ -10180,7 +10180,7 @@ _mmplayer_set_mute(MMHandleType hplayer, int mute) // @
        vol_element = player->pipeline->audiobin[MMPLAYER_A_SINK].gst;
 
        /* NOTE : volume will only created when the bt is enabled */
-       if ( vol_element )
+       if (vol_element)
        {
                LOGD("mute : %d\n", mute);
                g_object_set(vol_element, "mute", mute, NULL);
@@ -10202,11 +10202,11 @@ _mmplayer_get_mute(MMHandleType hplayer, int* pmute) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( pmute, MM_ERROR_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(pmute, MM_ERROR_INVALID_ARGUMENT);
 
        /* just hold mute value if pipeline is not ready */
-       if ( !player->pipeline || !player->pipeline->audiobin )
+       if (!player->pipeline || !player->pipeline->audiobin)
        {
                LOGD("pipeline is not ready. returning stored value\n");
                *pmute = player->sound.mute;
@@ -10227,7 +10227,7 @@ _mmplayer_set_videostream_changed_cb(MMHandleType hplayer, mm_player_stream_chan
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->video_stream_changed_cb = callback;
        player->video_stream_changed_cb_user_param = user_param;
@@ -10245,7 +10245,7 @@ _mmplayer_set_audiostream_changed_cb(MMHandleType hplayer, mm_player_stream_chan
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->audio_stream_changed_cb = callback;
        player->audio_stream_changed_cb_user_param = user_param;
@@ -10263,7 +10263,7 @@ _mmplayer_set_audiostream_cb_ex(MMHandleType hplayer, bool sync, mm_player_audio
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->audio_stream_render_cb_ex = callback;
        player->audio_stream_cb_user_param = user_param;
@@ -10282,7 +10282,7 @@ _mmplayer_set_videostream_cb(MMHandleType hplayer, mm_player_video_stream_callba
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (callback && !player->bufmgr)
                player->bufmgr = tbm_bufmgr_init(-1);
@@ -10305,7 +10305,7 @@ _mmplayer_set_audiostream_cb(MMHandleType hplayer, mm_player_audio_stream_callba
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->audio_stream_cb = callback;
        player->audio_stream_cb_user_param = user_param;
@@ -10324,14 +10324,14 @@ _mmplayer_set_prepare_buffering_time(MMHandleType hplayer, int second)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (MMPLAYER_CURRENT_STATE(player) !=  MM_PLAYER_STATE_NULL)
                return MM_ERROR_PLAYER_INVALID_STATE;
 
        LOGD("pre buffer size : %d sec\n", second);
 
-       if ( second <= 0 )
+       if (second <= 0)
        {
                LOGE("bad size value\n");
                return MM_ERROR_INVALID_ARGUMENT;
@@ -10358,7 +10358,7 @@ _mmplayer_set_runtime_buffering_mode(MMHandleType hplayer, MMPlayerBufferingMode
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        LOGD("mode %d\n", mode);
 
@@ -10376,7 +10376,7 @@ _mmplayer_set_runtime_buffering_mode(MMHandleType hplayer, MMPlayerBufferingMode
 
        if ((second > 0) &&
                ((mode == MM_PLAYER_BUFFERING_MODE_FIXED) ||
-                (mode == MM_PLAYER_BUFFERING_MODE_ADAPTIVE)))
+               (mode == MM_PLAYER_BUFFERING_MODE_ADAPTIVE)))
                player->streamer->buffering_req.runtime_second = second;
 
        MMPLAYER_FLEAVE();
@@ -10390,27 +10390,27 @@ __mmplayer_start_streaming_ext(mm_player_t *player)
        gint ret = MM_ERROR_NONE;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (MMPLAYER_IS_HTTP_PD(player))
        {
-               if ( !player->pd_downloader )
+               if (!player->pd_downloader)
                {
                        ret = __mmplayer_realize_streaming_ext(player);
 
-                       if ( ret != MM_ERROR_NONE)
+                       if (ret != MM_ERROR_NONE)
                        {
-                               LOGE ("failed to realize streaming ext\n");
+                               LOGE("failed to realize streaming ext\n");
                                return ret;
                        }
                }
 
                if (player->pd_downloader && player->pd_mode == MM_PLAYER_PD_MODE_URI)
                {
-                       ret = _mmplayer_start_pd_downloader ((MMHandleType)player);
-                       if ( !ret )
+                       ret = _mmplayer_start_pd_downloader((MMHandleType)player);
+                       if (!ret)
                        {
-                               LOGE ("ERROR while starting PD...\n");
+                               LOGE("ERROR while starting PD...\n");
                                return MM_ERROR_PLAYER_NOT_INITIALIZED;
                        }
                        ret = MM_ERROR_NONE;
@@ -10429,13 +10429,13 @@ _mmplayer_start(MMHandleType hplayer) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* check current state */
-       MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_START );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_START);
 
        ret = _mmplayer_sound_acquire_focus(&player->sound_focus);
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to acquire sound focus.\n");
                return ret;
@@ -10444,10 +10444,10 @@ _mmplayer_start(MMHandleType hplayer) // @
        /* NOTE : we should check and create pipeline again if not created as we destroy
         * whole pipeline when stopping in streamming playback
         */
-       if ( ! player->pipeline )
+       if (!player->pipeline)
        {
-               ret = __gst_realize( player );
-               if ( MM_ERROR_NONE != ret )
+               ret = __gst_realize(player);
+               if (MM_ERROR_NONE != ret)
                {
                        LOGE("failed to realize before starting. only in streamming\n");
                        /* unlock */
@@ -10456,14 +10456,14 @@ _mmplayer_start(MMHandleType hplayer) // @
        }
 
        ret = __mmplayer_start_streaming_ext(player);
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to start streaming ext \n");
        }
 
        /* start pipeline */
-       ret = __gst_start( player );
-       if ( ret != MM_ERROR_NONE )
+       ret = __gst_start(player);
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to start player.\n");
        }
@@ -10483,7 +10483,7 @@ int
 __mmplayer_handle_missed_plugin(mm_player_t* player)
 {
        MMMessageParamType msg_param;
-       memset (&msg_param, 0, sizeof(MMMessageParamType));
+       memset(&msg_param, 0, sizeof(MMMessageParamType));
        gboolean post_msg_direct = FALSE;
 
        MMPLAYER_FENTER();
@@ -10493,12 +10493,12 @@ __mmplayer_handle_missed_plugin(mm_player_t* player)
        LOGD("not_supported_codec = 0x%02x, can_support_codec = 0x%02x\n",
                        player->not_supported_codec, player->can_support_codec);
 
-       if( player->not_found_demuxer )
+       if (player->not_found_demuxer)
        {
                msg_param.code = MM_ERROR_PLAYER_CODEC_NOT_FOUND;
                msg_param.data = g_strdup_printf("%s", player->unlinked_demuxer_mime);
 
-               MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
                MMPLAYER_FREEIF(msg_param.data);
 
                return MM_ERROR_NONE;
@@ -10506,29 +10506,29 @@ __mmplayer_handle_missed_plugin(mm_player_t* player)
 
        if (player->not_supported_codec)
        {
-               if ( player->can_support_codec ) // There is one codec to play
+               if (player->can_support_codec) // There is one codec to play
                {
                        post_msg_direct = TRUE;
                }
                else
                {
-                       if ( player->pipeline->audiobin ) // Some content has only PCM data in container.
+                       if (player->pipeline->audiobin) // Some content has only PCM data in container.
                                post_msg_direct = TRUE;
                }
 
-               if ( post_msg_direct )
+               if (post_msg_direct)
                {
                        MMMessageParamType msg_param;
-                       memset (&msg_param, 0, sizeof(MMMessageParamType));
+                       memset(&msg_param, 0, sizeof(MMMessageParamType));
 
-                       if ( player->not_supported_codec ==  MISSING_PLUGIN_AUDIO )
+                       if (player->not_supported_codec ==  MISSING_PLUGIN_AUDIO)
                        {
                                LOGW("not found AUDIO codec, posting error code to application.\n");
 
                                msg_param.code = MM_ERROR_PLAYER_AUDIO_CODEC_NOT_FOUND;
                                msg_param.data = g_strdup_printf("%s", player->unlinked_audio_mime);
                        }
-                       else if ( player->not_supported_codec ==  MISSING_PLUGIN_VIDEO )
+                       else if (player->not_supported_codec ==  MISSING_PLUGIN_VIDEO)
                        {
                                LOGW("not found VIDEO codec, posting error code to application.\n");
 
@@ -10536,7 +10536,7 @@ __mmplayer_handle_missed_plugin(mm_player_t* player)
                                msg_param.data = g_strdup_printf("%s", player->unlinked_video_mime);
                        }
 
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
 
                        MMPLAYER_FREEIF(msg_param.data);
 
@@ -10546,7 +10546,7 @@ __mmplayer_handle_missed_plugin(mm_player_t* player)
                {
                        LOGW("not found any codec, posting error code to application.\n");
 
-                       if ( player->not_supported_codec ==  MISSING_PLUGIN_AUDIO )
+                       if (player->not_supported_codec ==  MISSING_PLUGIN_AUDIO)
                        {
                                msg_param.code = MM_ERROR_PLAYER_AUDIO_CODEC_NOT_FOUND;
                                msg_param.data = g_strdup_printf("%s", player->unlinked_audio_mime);
@@ -10557,7 +10557,7 @@ __mmplayer_handle_missed_plugin(mm_player_t* player)
                                msg_param.data = g_strdup_printf("%s, %s", player->unlinked_video_mime, player->unlinked_audio_mime);
                        }
 
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
 
                        MMPLAYER_FREEIF(msg_param.data);
                }
@@ -10582,14 +10582,14 @@ static void __mmplayer_check_pipeline(mm_player_t* player)
                MMPLAYER_PLAYBACK_LOCK(player);
                MMPLAYER_PLAYBACK_UNLOCK(player);
 
-               timeout = MMPLAYER_STATE_CHANGE_TIMEOUT ( player );
+               timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player);
 
                /* wait for state transition */
-               ret = gst_element_get_state( player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, &element_state, &element_pending_state, timeout * GST_SECOND );
+               ret = gst_element_get_state(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, &element_state, &element_pending_state, timeout * GST_SECOND);
 
-               if ( ret == GST_STATE_CHANGE_FAILURE )
+               if (ret == GST_STATE_CHANGE_FAILURE)
                {
-                       LOGE("failed to change pipeline state within %d sec\n", timeout );
+                       LOGE("failed to change pipeline state within %d sec\n", timeout);
                }
        }
 }
@@ -10603,17 +10603,17 @@ _mmplayer_stop(MMHandleType hplayer) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* check current state */
-       MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_STOP );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_STOP);
 
        /* check pipline building state */
        __mmplayer_check_pipeline(player);
        __mmplayer_reset_gapless_state(player);
 
        /* NOTE : application should not wait for EOS after calling STOP */
-       __mmplayer_cancel_eos_timer( player );
+       __mmplayer_cancel_eos_timer(player);
 
        __mmplayer_unrealize_streaming_ext(player);
 
@@ -10621,9 +10621,9 @@ _mmplayer_stop(MMHandleType hplayer) // @
        player->doing_seek = FALSE;
 
        /* stop pipeline */
-       ret = __gst_stop( player );
+       ret = __gst_stop(player);
 
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to stop player.\n");
        }
@@ -10643,10 +10643,10 @@ _mmplayer_pause(MMHandleType hplayer) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* check current state */
-       MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_PAUSE );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_PAUSE);
 
        /* check pipline building state */
        __mmplayer_check_pipeline(player);
@@ -10666,10 +10666,10 @@ _mmplayer_pause(MMHandleType hplayer) // @
                case MM_PLAYER_STATE_PLAYING:
                {
                        /* NOTE : store current point to overcome some bad operation
-                       * ( returning zero when getting current position in paused state) of some
+                       *(returning zero when getting current position in paused state) of some
                        * elements
                        */
-                       if ( !gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_msec))
+                       if (!gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_msec))
                                LOGW("getting current position failed in paused\n");
 
                        player->last_position = pos_msec;
@@ -10683,16 +10683,16 @@ _mmplayer_pause(MMHandleType hplayer) // @
        }
 
        /* pause pipeline */
-       ret = __gst_pause( player, async );
+       ret = __gst_pause(player, async);
 
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to pause player. ret : 0x%x\n", ret);
        }
 
        if (MMPLAYER_PREV_STATE(player) == MM_PLAYER_STATE_READY && MMPLAYER_CURRENT_STATE(player) == MM_PLAYER_STATE_PAUSED)
        {
-               if ( MM_ERROR_NONE != _mmplayer_update_video_param( player, "display_rotation"))
+               if (MM_ERROR_NONE != _mmplayer_update_video_param(player, "display_rotation"))
                {
                        LOGE("failed to update display_rotation");
                }
@@ -10712,21 +10712,21 @@ _mmplayer_resume(MMHandleType hplayer)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        ret = _mmplayer_sound_acquire_focus(&player->sound_focus);
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to acquire sound focus.\n");
                return ret;
        }
 
        /* check current state */
-       MMPLAYER_CHECK_STATE( player, MMPLAYER_COMMAND_RESUME );
+       MMPLAYER_CHECK_STATE(player, MMPLAYER_COMMAND_RESUME);
 
-       ret = __gst_resume( player, async );
+       ret = __gst_resume(player, async);
 
-       if ( ret != MM_ERROR_NONE )
+       if (ret != MM_ERROR_NONE)
        {
                LOGE("failed to resume player.\n");
        }
@@ -10743,17 +10743,17 @@ __mmplayer_set_play_count(mm_player_t* player, gint count)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        attrs =  MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("fail to get attributes.\n");
                return MM_ERROR_PLAYER_INTERNAL;
        }
 
        mm_attrs_set_int_by_name(attrs, "profile_play_count", count);
-       if ( mmf_attrs_commit ( attrs ) ) /* return -1 if error */
+       if (mmf_attrs_commit(attrs)) /* return -1 if error */
                LOGE("failed to commit\n");
 
        MMPLAYER_FLEAVE();
@@ -10771,8 +10771,8 @@ _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, uns
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( end <= GST_TIME_AS_MSECONDS(player->duration), MM_ERROR_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(end <= GST_TIME_AS_MSECONDS(player->duration), MM_ERROR_INVALID_ARGUMENT);
 
        player->section_repeat = TRUE;
        player->section_repeat_start = start;
@@ -10781,12 +10781,12 @@ _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, uns
        start_pos = player->section_repeat_start * G_GINT64_CONSTANT(1000000);
        end_pos = player->section_repeat_end * G_GINT64_CONSTANT(1000000);
 
-       __mmplayer_set_play_count( player, infinity );
+       __mmplayer_set_play_count(player, infinity);
 
-       if ( (!__gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
+       if ((!__gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
                                        player->playback_rate,
                                        GST_FORMAT_TIME,
-                                       ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
+                                       (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
                                        GST_SEEK_TYPE_SET, start_pos,
                                        GST_SEEK_TYPE_SET, end_pos)))
        {
@@ -10816,7 +10816,7 @@ __mmplayer_set_pcm_extraction(mm_player_t* player)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        mm_attrs_multiple_get(player->attrs,
                NULL,
@@ -10824,14 +10824,14 @@ __mmplayer_set_pcm_extraction(mm_player_t* player)
                "pcm_extraction_end_msec", &required_end,
                NULL);
 
-       LOGD("pcm extraction required position is from [%d] to [%d] (msec)\n", required_start, required_end);
+       LOGD("pcm extraction required position is from [%d] to [%d](msec)\n", required_start, required_end);
 
        if (required_start == 0 && required_end == 0)
        {
                LOGD("extracting entire stream");
                return MM_ERROR_NONE;
        }
-       else if (required_start < 0 || required_start > required_end || required_end < 0 )
+       else if (required_start < 0 || required_start > required_end || required_end < 0)
        {
                LOGD("invalid range for pcm extraction");
                return MM_ERROR_INVALID_ARGUMENT;
@@ -10839,7 +10839,7 @@ __mmplayer_set_pcm_extraction(mm_player_t* player)
 
        /* get duration */
        ret = gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec);
-       if ( !ret )
+       if (!ret)
        {
                LOGE("failed to get duration");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -10855,10 +10855,10 @@ __mmplayer_set_pcm_extraction(mm_player_t* player)
        start_nsec = required_start * G_GINT64_CONSTANT(1000000);
        end_nsec = required_end * G_GINT64_CONSTANT(1000000);
 
-       if ( (!__gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
+       if ((!__gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
                                        1.0,
                                        GST_FORMAT_TIME,
-                                       ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
+                                       (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
                                        GST_SEEK_TYPE_SET, start_nsec,
                                        GST_SEEK_TYPE_SET, end_nsec)))
        {
@@ -10867,7 +10867,7 @@ __mmplayer_set_pcm_extraction(mm_player_t* player)
                return MM_ERROR_PLAYER_SEEK;
        }
 
-       LOGD("succeeded to set up segment extraction from [%llu] to [%llu] (nsec)\n", start_nsec, end_nsec);
+       LOGD("succeeded to set up segment extraction from [%llu] to [%llu](nsec)\n", start_nsec, end_nsec);
 
        MMPLAYER_FLEAVE();
 
@@ -10883,20 +10883,20 @@ _mmplayer_deactivate_section_repeat(MMHandleType hplayer)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->section_repeat = FALSE;
 
-       __mmplayer_set_play_count( player, onetime );
+       __mmplayer_set_play_count(player, onetime);
 
        gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &cur_pos);
 
-       if ( (!__gst_seek( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
+       if ((!__gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
                                        1.0,
                                        GST_FORMAT_TIME,
-                                       ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
+                                       (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
                                        GST_SEEK_TYPE_SET, cur_pos,
-                                       GST_SEEK_TYPE_SET, player->duration )))
+                                       GST_SEEK_TYPE_SET, player->duration)))
        {
                LOGE("failed to deactivate section repeat\n");
 
@@ -10919,11 +10919,11 @@ _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming)
        MMPlayerStateType current_state = MM_PLAYER_STATE_NONE;
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( streaming || !MMPLAYER_IS_STREAMING(player), MM_ERROR_NOT_SUPPORT_API );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(streaming || !MMPLAYER_IS_STREAMING(player), MM_ERROR_NOT_SUPPORT_API);
 
        /* The sound of video is not supported under 0.0 and over 2.0. */
-       if(rate >= TRICK_PLAY_MUTE_THRESHOLD_MAX || rate < TRICK_PLAY_MUTE_THRESHOLD_MIN)
+       if (rate >= TRICK_PLAY_MUTE_THRESHOLD_MAX || rate < TRICK_PLAY_MUTE_THRESHOLD_MIN)
        {
                if (player->can_support_codec & FOUND_PLUGIN_VIDEO)
                        mute = TRUE;
@@ -10940,21 +10940,21 @@ _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming)
 
        current_state = MMPLAYER_CURRENT_STATE(player);
 
-       if ( current_state != MM_PLAYER_STATE_PAUSED )
+       if (current_state != MM_PLAYER_STATE_PAUSED)
                ret = gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_msec);
 
-       LOGD ("pos_msec = %"GST_TIME_FORMAT" and ret = %d and state = %d", GST_TIME_ARGS (pos_msec), ret, current_state);
+       LOGD("pos_msec = %"GST_TIME_FORMAT" and ret = %d and state = %d", GST_TIME_ARGS(pos_msec), ret, current_state);
 
-       if ( ( current_state == MM_PLAYER_STATE_PAUSED )
-               || ( ! ret ))
-               //|| ( player->last_position != 0 && pos_msec == 0 ) )
+       if ((current_state == MM_PLAYER_STATE_PAUSED)
+               || (!ret))
+               //|| (player->last_position != 0 && pos_msec == 0))
        {
-               LOGW("returning last point : %lld\n", player->last_position );
+               LOGW("returning last point : %lld\n", player->last_position);
                pos_msec = player->last_position;
        }
 
 
-       if(rate >= 0)
+       if (rate >= 0)
        {
                start = pos_msec;
                stop = GST_CLOCK_TIME_NONE;
@@ -10964,10 +10964,10 @@ _mmplayer_set_playspeed(MMHandleType hplayer, float rate, bool streaming)
                start = GST_CLOCK_TIME_NONE;
                stop = pos_msec;
        }
-       if ((!gst_element_seek (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
+       if ((!gst_element_seek(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
                                rate,
                                GST_FORMAT_TIME,
-                               ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE ),
+                               (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
                                GST_SEEK_TYPE_SET, start,
                                 GST_SEEK_TYPE_SET, stop)))
        {
@@ -10990,12 +10990,12 @@ _mmplayer_set_position(MMHandleType hplayer, int format, int position) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        /* check pipline building state */
        __mmplayer_check_pipeline(player);
 
-       ret = __gst_set_position ( player, format, (unsigned long)position, FALSE );
+       ret = __gst_set_position(player, format, (unsigned long)position, FALSE);
 
        MMPLAYER_FLEAVE();
 
@@ -11008,9 +11008,9 @@ _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *position
        mm_player_t* player = (mm_player_t*)hplayer;
        int ret = MM_ERROR_NONE;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       ret = __gst_get_position ( player, format, position );
+       ret = __gst_get_position(player, format, position);
 
        return ret;
 }
@@ -11021,9 +11021,9 @@ _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* s
        mm_player_t* player = (mm_player_t*)hplayer;
        int ret = MM_ERROR_NONE;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       ret = __gst_get_buffer_position ( player, format, start_pos, stop_pos );
+       ret = __gst_get_buffer_position(player, format, start_pos, stop_pos);
 
        return ret;
 }
@@ -11036,7 +11036,7 @@ _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format, int position
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        ret = __gst_adjust_subtitle_position(player, format, position);
 
@@ -11052,7 +11052,7 @@ _mmplayer_adjust_video_postion(MMHandleType hplayer, int offset) // @
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        ret = __gst_adjust_video_position(player, offset);
 
@@ -11062,15 +11062,15 @@ _mmplayer_adjust_video_postion(MMHandleType hplayer, int offset) // @
 }
 
 static gboolean
-__mmplayer_is_midi_type( gchar* str_caps)
+__mmplayer_is_midi_type(gchar* str_caps)
 {
-       if ( ( g_strrstr(str_caps, "audio/midi") ) ||
-               ( g_strrstr(str_caps, "application/x-gst_ff-mmf") ) ||
-               ( g_strrstr(str_caps, "application/x-smaf") ) ||
-               ( g_strrstr(str_caps, "audio/x-imelody") ) ||
-               ( g_strrstr(str_caps, "audio/mobile-xmf") ) ||
-               ( g_strrstr(str_caps, "audio/xmf") ) ||
-               ( g_strrstr(str_caps, "audio/mxmf") ) )
+       if ((g_strrstr(str_caps, "audio/midi")) ||
+               (g_strrstr(str_caps, "application/x-gst_ff-mmf")) ||
+               (g_strrstr(str_caps, "application/x-smaf")) ||
+               (g_strrstr(str_caps, "audio/x-imelody")) ||
+               (g_strrstr(str_caps, "audio/mobile-xmf")) ||
+               (g_strrstr(str_caps, "audio/xmf")) ||
+               (g_strrstr(str_caps, "audio/mxmf")))
        {
                LOGD("midi\n");
 
@@ -11081,10 +11081,10 @@ __mmplayer_is_midi_type( gchar* str_caps)
 }
 
 static gboolean
-__mmplayer_is_only_mp3_type (gchar *str_caps)
+__mmplayer_is_only_mp3_type(gchar *str_caps)
 {
        if (g_strrstr(str_caps, "application/x-id3") ||
-               (g_strrstr(str_caps, "audio/mpeg") && g_strrstr(str_caps, "mpegversion=(int)1")))
+               (g_strrstr(str_caps, "audio/mpeg") && g_strrstr(str_caps, "mpegversion= (int)1")))
        {
                return TRUE;
        }
@@ -11092,32 +11092,32 @@ __mmplayer_is_only_mp3_type (gchar *str_caps)
 }
 
 static void
-__mmplayer_set_audio_attrs (mm_player_t* player, GstCaps* caps)
+__mmplayer_set_audio_attrs(mm_player_t* player, GstCaps* caps)
 {
        GstStructure* caps_structure = NULL;
        gint samplerate = 0;
        gint channels = 0;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL (player && caps);
+       MMPLAYER_RETURN_IF_FAIL(player && caps);
 
        caps_structure = gst_caps_get_structure(caps, 0);
 
        /* set stream information */
-       gst_structure_get_int (caps_structure, "rate", &samplerate);
-       mm_attrs_set_int_by_name (player->attrs, "content_audio_samplerate", samplerate);
+       gst_structure_get_int(caps_structure, "rate", &samplerate);
+       mm_attrs_set_int_by_name(player->attrs, "content_audio_samplerate", samplerate);
 
-       gst_structure_get_int (caps_structure, "channels", &channels);
-       mm_attrs_set_int_by_name (player->attrs, "content_audio_channels", channels);
+       gst_structure_get_int(caps_structure, "channels", &channels);
+       mm_attrs_set_int_by_name(player->attrs, "content_audio_channels", channels);
 
-       LOGD ("audio samplerate : %d    channels : %d\n", samplerate, channels);
+       LOGD("audio samplerate : %d     channels : %d\n", samplerate, channels);
 }
 
 static void
 __mmplayer_update_content_type_info(mm_player_t* player)
 {
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL( player && player->type);
+       MMPLAYER_RETURN_IF_FAIL(player && player->type);
 
        if (__mmplayer_is_midi_type(player->type))
        {
@@ -11145,7 +11145,7 @@ __mmplayer_update_content_type_info(mm_player_t* player)
 }
 
 static void
-__mmplayer_typefind_have_type(  GstElement *tf, guint probability,  // @
+__mmplayer_typefind_have_type( GstElement *tf, guint probability,  // @
 GstCaps *caps, gpointer data)
 {
        mm_player_t* player = (mm_player_t*)data;
@@ -11153,7 +11153,7 @@ GstCaps *caps, gpointer data)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL( player && tf && caps );
+       MMPLAYER_RETURN_IF_FAIL(player && tf && caps);
 
        /* store type string */
        MMPLAYER_FREEIF(player->type);
@@ -11161,19 +11161,19 @@ GstCaps *caps, gpointer data)
        if (player->type)
                LOGD("meida type %s found, probability %d%% / %d\n", player->type, probability, gst_caps_get_size(caps));
 
-       if ( (!MMPLAYER_IS_WFD_STREAMING( player )) &&
-                (!MMPLAYER_IS_RTSP_STREAMING( player )) &&
-                (g_strrstr(player->type, "audio/x-raw-int")))
+       if ((!MMPLAYER_IS_WFD_STREAMING(player)) &&
+               (!MMPLAYER_IS_RTSP_STREAMING(player)) &&
+               (g_strrstr(player->type, "audio/x-raw-int")))
        {
                LOGE("not support media format\n");
 
                if (player->msg_posted == FALSE)
                {
                        MMMessageParamType msg_param;
-                       memset (&msg_param, 0, sizeof(MMMessageParamType));
+                       memset(&msg_param, 0, sizeof(MMMessageParamType));
 
                        msg_param.code = MM_ERROR_PLAYER_NOT_SUPPORTED_FORMAT;
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
+                       MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
 
                        /* don't post more if one was sent already */
                        player->msg_posted = TRUE;
@@ -11184,7 +11184,7 @@ GstCaps *caps, gpointer data)
        __mmplayer_update_content_type_info(player);
 
        pad = gst_element_get_static_pad(tf, "src");
-       if ( !pad )
+       if (!pad)
        {
                LOGE("fail to get typefind src pad.\n");
                return;
@@ -11192,16 +11192,16 @@ GstCaps *caps, gpointer data)
 
        if (player->use_decodebin)
        {
-               if(!__mmplayer_try_to_plug_decodebin( player, pad, caps ))
+               if (!__mmplayer_try_to_plug_decodebin(player, pad, caps))
                {
                        gboolean async = FALSE;
                        LOGE("failed to autoplug %s\n", player->type);
 
                        mm_attrs_get_int_by_name(player->attrs, "profile_prepare_async", &async);
 
-                       if ( async && player->msg_posted == FALSE )
+                       if (async && player->msg_posted == FALSE)
                        {
-                               __mmplayer_handle_missed_plugin( player );
+                               __mmplayer_handle_missed_plugin(player);
                        }
 
                        goto DONE;
@@ -11210,33 +11210,33 @@ GstCaps *caps, gpointer data)
        else
        {
                /* try to plug */
-               if ( ! __mmplayer_try_to_plug( player, pad, caps ) )
+               if (!__mmplayer_try_to_plug(player, pad, caps))
                {
                        gboolean async = FALSE;
                        LOGE("failed to autoplug %s\n", player->type);
 
                        mm_attrs_get_int_by_name(player->attrs, "profile_prepare_async", &async);
 
-                       if ( async && player->msg_posted == FALSE )
+                       if (async && player->msg_posted == FALSE)
                        {
-                               __mmplayer_handle_missed_plugin( player );
+                               __mmplayer_handle_missed_plugin(player);
                        }
 
                        goto DONE;
                }
 
                /* finish autopluging if no dynamic pad waiting */
-               if( ( ! player->have_dynamic_pad) && ( ! player->has_many_types) )
+               if ((!player->have_dynamic_pad) && (!player->has_many_types))
                {
-                       if ( ! MMPLAYER_IS_RTSP_STREAMING( player ) )
+                       if (!MMPLAYER_IS_RTSP_STREAMING(player))
                        {
-                               __mmplayer_pipeline_complete( NULL, (gpointer)player );
+                               __mmplayer_pipeline_complete(NULL, (gpointer)player);
                        }
                }
        }
 
 DONE:
-       gst_object_unref( GST_OBJECT(pad) );
+       gst_object_unref(GST_OBJECT(pad));
 
        MMPLAYER_FLEAVE();
 
@@ -11244,7 +11244,7 @@ DONE:
 }
 
 static GstElement *
-__mmplayer_create_decodebin (mm_player_t* player)
+__mmplayer_create_decodebin(mm_player_t* player)
 {
        GstElement *decodebin = NULL;
 
@@ -11260,37 +11260,37 @@ __mmplayer_create_decodebin (mm_player_t* player)
        }
 
        /* raw pad handling signal */
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
                                                G_CALLBACK(__mmplayer_gst_decode_pad_added), player);
 
        /* no-more-pad pad handling signal */
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
                                                G_CALLBACK(__mmplayer_gst_decode_no_more_pads), player);
 
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-removed",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-removed",
                                                G_CALLBACK(__mmplayer_gst_decode_pad_removed), player);
 
        /* This signal is emitted when a pad for which there is no further possible
           decoding is added to the decodebin.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "unknown-type",
-                                               G_CALLBACK(__mmplayer_gst_decode_unknown_type), player );
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "unknown-type",
+                                               G_CALLBACK(__mmplayer_gst_decode_unknown_type), player);
 
        /* This signal is emitted whenever decodebin finds a new stream. It is emitted
           before looking for any elements that can handle that stream.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-continue",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-continue",
                                                G_CALLBACK(__mmplayer_gst_decode_autoplug_continue), player);
 
        /* This signal is emitted whenever decodebin finds a new stream. It is emitted
           before looking for any elements that can handle that stream.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "autoplug-select",
                                                G_CALLBACK(__mmplayer_gst_decode_autoplug_select), player);
 
        /* This signal is emitted once decodebin has finished decoding all the data.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "drained",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "drained",
                                                G_CALLBACK(__mmplayer_gst_decode_drained), player);
 
        /* This signal is emitted when a element is added to the bin.*/
-       MMPLAYER_SIGNAL_CONNECT( player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added",
+       MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(decodebin), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "element-added",
                                                G_CALLBACK(__mmplayer_gst_element_added), player);
 
 ERROR:
@@ -11312,25 +11312,25 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
        gdouble init_buffering_time = (gdouble)player->streamer->buffering_req.initial_second;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL (player && player->pipeline && player->pipeline->mainbin, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline && player->pipeline->mainbin, FALSE);
 
        mainbin = player->pipeline->mainbin;
 
        if ((!MMPLAYER_IS_HTTP_PD(player)) &&
                (MMPLAYER_IS_HTTP_STREAMING(player)))
        {
-               LOGD ("creating http streaming buffering queue (queue2)\n");
+               LOGD("creating http streaming buffering queue(queue2)\n");
 
                if (mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst)
                {
-                       LOGE ("MMPLAYER_M_MUXED_S_BUFFER is not null\n");
+                       LOGE("MMPLAYER_M_MUXED_S_BUFFER is not null\n");
                }
                else
            {
-                       queue2 = gst_element_factory_make ("queue2", "queue2");
+                       queue2 = gst_element_factory_make("queue2", "queue2");
                        if (!queue2)
                        {
-                               LOGE ("failed to create buffering queue element\n");
+                               LOGE("failed to create buffering queue element\n");
                                goto ERROR;
                        }
 
@@ -11349,7 +11349,7 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
                                goto ERROR;
                        }
 
-                       if ( !gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
+                       if (!gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
                                LOGE("fail to get duration.\n");
 
                        LOGD("dur_bytes = %lld\n", dur_bytes);
@@ -11368,8 +11368,8 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
                        }
 
                        /* NOTE : we cannot get any duration info from ts container in case of streaming */
-                       // if(!g_strrstr(GST_ELEMENT_NAME(sinkelement), "mpegtsdemux"))
-                       if(!g_strrstr(player->type, "video/mpegts"))
+                       // if (!g_strrstr(GST_ELEMENT_NAME(sinkelement), "mpegtsdemux"))
+                       if (!g_strrstr(player->type, "video/mpegts"))
                        {
                                max_buffer_size_bytes = (type == MUXED_BUFFER_TYPE_FILE)?(player->ini.http_max_size_bytes):(5*1024*1024);
                                LOGD("max_buffer_size_bytes = %d\n", max_buffer_size_bytes);
@@ -11386,7 +11386,7 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
                                                                                                (guint64)dur_bytes);
                        }
 
-                       if (GST_STATE_CHANGE_FAILURE == gst_element_sync_state_with_parent (queue2))
+                       if (GST_STATE_CHANGE_FAILURE == gst_element_sync_state_with_parent(queue2))
                        {
                                LOGE("failed to sync queue2 state with parent\n");
                                goto ERROR;
@@ -11419,7 +11419,7 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
        /* to force caps on the decodebin element and avoid reparsing stuff by
        * typefind. It also avoids a deadlock in the way typefind activates pads in
        * the state change */
-       g_object_set (decodebin, "sink-caps", caps, NULL);
+       g_object_set(decodebin, "sink-caps", caps, NULL);
 
        sinkpad = gst_element_get_static_pad(decodebin, "sink");
 
@@ -11437,8 +11437,8 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
        /* set decodebin property about buffer in streaming playback. *
         * in case of hls, it does not need to have big buffer        *
         * because it is kind of adaptive streaming.                  */
-       if ( ((!MMPLAYER_IS_HTTP_PD(player)) &&
-           (MMPLAYER_IS_HTTP_STREAMING(player))) || MMPLAYER_IS_DASH_STREAMING (player))
+       if (((!MMPLAYER_IS_HTTP_PD(player)) &&
+          (MMPLAYER_IS_HTTP_STREAMING(player))) || MMPLAYER_IS_DASH_STREAMING(player))
        {
                guint max_size_bytes = MAX_DECODEBIN_BUFFER_BYTES;
                guint64 max_size_time = MAX_DECODEBIN_BUFFER_TIME;
@@ -11449,7 +11449,7 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
                        max_size_time = MAX_DECODEBIN_ADAPTIVE_BUFFER_TIME;
                }
 
-               g_object_set (G_OBJECT(decodebin), "use-buffering", TRUE,
+               g_object_set(G_OBJECT(decodebin), "use-buffering", TRUE,
                                                                                        "high-percent", (gint)player->ini.http_buffering_limit,
                                                                                        "low-percent", 1,   // 1%
                                                                                        "max-size-bytes", max_size_bytes,
@@ -11469,7 +11469,7 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
 
 ERROR:
 
-       MMPLAYER_FREEIF( caps_str );
+       MMPLAYER_FREEIF(caps_str);
 
        if (sinkpad)
                gst_object_unref(GST_OBJECT(sinkpad));
@@ -11485,8 +11485,8 @@ ERROR:
                /* And, it still has a parent "player".
                 * You need to let the parent manage the object instead of unreffing the object directly.
                 */
-               gst_bin_remove (GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue2);
-               gst_object_unref (queue2);
+               gst_bin_remove(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue2);
+               gst_object_unref(queue2);
                queue2 = NULL;
        }
 
@@ -11502,8 +11502,8 @@ ERROR:
                 * You need to let the parent manage the object instead of unreffing the object directly.
                 */
 
-               gst_bin_remove (GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), decodebin);
-               gst_object_unref (decodebin);
+               gst_bin_remove(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), decodebin);
+               gst_object_unref(decodebin);
                decodebin = NULL;
        }
 
@@ -11526,14 +11526,14 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player && player->pipeline && player->pipeline->mainbin, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline && player->pipeline->mainbin, FALSE);
 
        mainbin = player->pipeline->mainbin;
 
        mime = gst_structure_get_name(gst_caps_get_structure(caps, 0));
 
        /* return if we got raw output */
-       if(g_str_has_prefix(mime, "video/x-raw") || g_str_has_prefix(mime, "audio/x-raw")
+       if (g_str_has_prefix(mime, "video/x-raw") || g_str_has_prefix(mime, "audio/x-raw")
                || g_str_has_prefix(mime, "text/plain") ||g_str_has_prefix(mime, "text/x-pango-markup"))
        {
 
@@ -11548,30 +11548,30 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                 * has linked. if so, we need to add queue for quality of output. note that
                 * decodebin also has same problem.
                 */
-               klass = gst_element_factory_get_metadata (gst_element_get_factory(element), GST_ELEMENT_METADATA_KLASS);
+               klass = gst_element_factory_get_metadata(gst_element_get_factory(element), GST_ELEMENT_METADATA_KLASS);
 
                /* add queue if needed */
-               if(g_strrstr(klass, "Demux") || g_strrstr(klass, "Depayloader")
+               if ((g_strrstr(klass, "Demux") || g_strrstr(klass, "Depayloader")
                        || g_strrstr(klass, "Parse")) &&  !g_str_has_prefix(mime, "text"))
                {
                        LOGD("adding raw queue\n");
 
                        queue = gst_element_factory_make("queue", NULL);
-                       if ( ! queue )
+                       if (!queue)
                        {
                                LOGW("failed to create queue\n");
                                goto ERROR;
                        }
 
                        /* warmup */
-                       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_READY) )
+                       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_READY))
                        {
                                LOGW("failed to set state READY to queue\n");
                                goto ERROR;
                        }
 
                        /* add to pipeline */
-                       if ( ! gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue) )
+                       if (!gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue))
                        {
                                LOGW("failed to add queue\n");
                                goto ERROR;
@@ -11580,16 +11580,16 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                        /* link queue */
                        queue_pad = gst_element_get_static_pad(queue, "sink");
 
-                       if ( GST_PAD_LINK_OK != gst_pad_link(pad, queue_pad) )
+                       if (GST_PAD_LINK_OK != gst_pad_link(pad, queue_pad))
                        {
                                LOGW("failed to link queue\n");
                                goto ERROR;
                        }
-                       gst_object_unref ( GST_OBJECT(queue_pad) );
+                       gst_object_unref(GST_OBJECT(queue_pad));
                        queue_pad = NULL;
 
                        /* running */
-                       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_PAUSED) )
+                       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_PAUSED))
                        {
                                LOGW("failed to set state PAUSED to queue\n");
                                goto ERROR;
@@ -11597,7 +11597,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
 
                        /* replace given pad to queue:src */
                        pad = gst_element_get_static_pad(queue, "src");
-                       if ( ! pad )
+                       if (!pad)
                        {
                                LOGW("failed to get pad from queue\n");
                                goto ERROR;
@@ -11607,17 +11607,17 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                /* check if player can do start continually */
                MMPLAYER_CHECK_CMD_IF_EXIT(player);
 
-               if(__mmplayer_link_sink(player,pad))
+               if (__mmplayer_link_sink(player,pad))
                        __mmplayer_gst_decode_callback(element, pad, player);
 
-               gst_object_unref( GST_OBJECT(element));
+               gst_object_unref(GST_OBJECT(element));
                element = NULL;
 
                return TRUE;
        }
 
        item = player->factories;
-       for(; item != NULL ; item = item->next)
+       for (; item != NULL ; item = item->next)
        {
                GstElementFactory *factory = GST_ELEMENT_FACTORY(item->data);
                const GList *pads;
@@ -11626,35 +11626,35 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                skip = FALSE;
 
                /* filtering exclude keyword */
-               for ( idx = 0; player->ini.exclude_element_keyword[idx][0] != '\0'; idx++ )
+               for (idx = 0; player->ini.exclude_element_keyword[idx][0] != '\0'; idx++)
                {
-                       if ( g_strrstr(GST_OBJECT_NAME (factory),
-                                       player->ini.exclude_element_keyword[idx] ) )
+                       if (g_strrstr(GST_OBJECT_NAME(factory),
+                                       player->ini.exclude_element_keyword[idx]))
                        {
                                LOGW("skipping [%s] by exculde keyword [%s]\n",
-                                       GST_OBJECT_NAME (factory),
-                                       player->ini.exclude_element_keyword[idx] );
+                                       GST_OBJECT_NAME(factory),
+                                       player->ini.exclude_element_keyword[idx]);
 
                                skip = TRUE;
                                break;
                        }
                }
 
-               if ( MMPLAYER_IS_RTSP_STREAMING(player) && g_strrstr(GST_OBJECT_NAME (factory), "omx_mpeg4dec"))
+               if (MMPLAYER_IS_RTSP_STREAMING(player) && g_strrstr(GST_OBJECT_NAME(factory), "omx_mpeg4dec"))
                {
                        // omx decoder can not support mpeg4video data partitioned
                        // rtsp streaming didn't know mpeg4video data partitioned format
                        // so, if rtsp playback, player will skip omx_mpeg4dec.
                        LOGW("skipping [%s] when rtsp streaming \n",
-                                       GST_OBJECT_NAME (factory));
+                                       GST_OBJECT_NAME(factory));
 
                        skip = TRUE;
                }
 
-               if ( skip ) continue;
+               if (skip) continue;
 
                /* check factory class for filtering */
-               klass = gst_element_factory_get_metadata (GST_ELEMENT_FACTORY(factory), GST_ELEMENT_METADATA_KLASS);
+               klass = gst_element_factory_get_metadata(GST_ELEMENT_FACTORY(factory), GST_ELEMENT_METADATA_KLASS);
 
                /*parsers are not required in case of external feeder*/
                if (g_strrstr(klass, "Codec/Parser") && MMPLAYER_IS_MS_BUFF_SRC(player))
@@ -11663,39 +11663,39 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                /* NOTE : msl don't need to use image plugins.
                 * So, those plugins should be skipped for error handling.
                 */
-               if ( g_strrstr(klass, "Codec/Decoder/Image") )
+               if (g_strrstr(klass, "Codec/Decoder/Image"))
                {
-                       LOGD("skipping [%s] by not required\n", GST_OBJECT_NAME (factory));
+                       LOGD("skipping [%s] by not required\n", GST_OBJECT_NAME(factory));
                        continue;
                }
 
                /* check pad compatability */
-               for(pads = gst_element_factory_get_static_pad_templates(factory);
+               for (pads = gst_element_factory_get_static_pad_templates(factory);
                                        pads != NULL; pads=pads->next)
                {
                        GstStaticPadTemplate *temp1 = pads->data;
                        GstCaps* static_caps = NULL;
 
-                       iftemp1->direction != GST_PAD_SINK
+                       if (temp1->direction != GST_PAD_SINK
                                || temp1->presence != GST_PAD_ALWAYS)
                                continue;
 
-                       if ( GST_IS_CAPS( &temp1->static_caps.caps) )
+                       if (GST_IS_CAPS(&temp1->static_caps.caps))
                        {
                                /* using existing caps */
-                               static_caps = gst_caps_ref(temp1->static_caps.caps );
+                               static_caps = gst_caps_ref(temp1->static_caps.caps);
                        }
                        else
                        {
                                /* create one */
-                               static_caps = gst_caps_from_string ( temp1->static_caps.string );
+                               static_caps = gst_caps_from_string(temp1->static_caps.string);
                        }
 
                        res = gst_caps_intersect((GstCaps*)caps, static_caps);
-                       gst_caps_unref( static_caps );
+                       gst_caps_unref(static_caps);
                        static_caps = NULL;
 
-                       if( res && !gst_caps_is_empty(res) )
+                       if (res && !gst_caps_is_empty(res))
                        {
                                GstElement *new_element;
                                GList *elements = player->parsers;
@@ -11707,7 +11707,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                if ((g_strrstr(klass, "Codec/Decoder/Audio")))
                                {
                                        /* consider mp3 audio only */
-                                       if ( !MMPLAYER_IS_STREAMING(player) && __mmplayer_is_only_mp3_type(player->type) )
+                                       if (!MMPLAYER_IS_STREAMING(player) && __mmplayer_is_only_mp3_type(player->type))
                                        {
                                                /* try to use ALP decoder first instead of selected decoder */
                                                GstElement *element = NULL;
@@ -11729,20 +11729,20 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                                {
                                                        LOGD("checking if ALP can be used or not");
                                                        element = gst_element_factory_make("omx_mp3dec", "omx mp3 decoder");
-                                                       if ( element )
+                                                       if (element)
                                                        {
                                                                /* check availability because multi-instance is not supported */
                                                                GstStateChangeReturn ret = gst_element_set_state(element, GST_STATE_READY);
 
                                                                if (ret != GST_STATE_CHANGE_SUCCESS) // use just selected decoder
                                                                {
-                                                                       gst_object_unref (element);
+                                                                       gst_object_unref(element);
                                                                }
                                                                else if (ret == GST_STATE_CHANGE_SUCCESS) // replace facotry to use omx
                                                                {
                                                                        /* clean  */
                                                                        gst_element_set_state(element, GST_STATE_NULL);
-                                                                       gst_object_unref (element);
+                                                                       gst_object_unref(element);
 
                                                                        element_facory = gst_element_factory_find("omx_mp3dec");
                                                                        /* replace, otherwise use selected thing instead */
@@ -11758,9 +11758,9 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                }
                                else if ((g_strrstr(klass, "Codec/Decoder/Video")))
                                {
-                                       if ( g_strrstr(GST_OBJECT_NAME(factory), "omx_") )
+                                       if (g_strrstr(GST_OBJECT_NAME(factory), "omx_"))
                                        {
-                                               char *env = getenv ("MM_PLAYER_HW_CODEC_DISABLE");
+                                               char *env = getenv("MM_PLAYER_HW_CODEC_DISABLE");
                                                if (env != NULL)
                                                {
                                                        if (strncasecmp(env, "yes", 3) == 0)
@@ -11776,10 +11776,10 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                LOGD("found %s to plug\n", name_to_plug);
 
                                new_element = gst_element_factory_create(GST_ELEMENT_FACTORY(factory), NULL);
-                               if ( ! new_element )
+                               if (!new_element)
                                {
                                        LOGE("failed to create element [%s]. continue with next.\n",
-                                               GST_OBJECT_NAME (factory));
+                                               GST_OBJECT_NAME(factory));
 
                                        MMPLAYER_FREEIF(name_template);
 
@@ -11793,7 +11793,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                {
                                        gchar *selected = NULL;
 
-                                       for ( ; elements; elements = g_list_next(elements))
+                                       for (; elements; elements = g_list_next(elements))
                                        {
                                                gchar *element_name = elements->data;
 
@@ -11815,7 +11815,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                }
 
                                /* store specific handles for futher control */
-                               if(g_strrstr(klass, "Demux") || g_strrstr(klass, "Parse"))
+                               if (g_strrstr(klass, "Demux") || g_strrstr(klass, "Parse"))
                                {
                                        /* FIXIT : first value will be overwritten if there's more
                                         * than 1 demuxer/parser
@@ -11825,7 +11825,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                        mainbin[MMPLAYER_M_DEMUX].gst = new_element;
 
                                        /*Added for multi audio support */
-                                       if(g_strrstr(klass, "Demux"))
+                                       if (g_strrstr(klass, "Demux"))
                                        {
                                                mainbin[MMPLAYER_M_DEMUX_EX].id = MMPLAYER_M_DEMUX_EX;
                                                mainbin[MMPLAYER_M_DEMUX_EX].gst = new_element;
@@ -11833,7 +11833,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                                /* NOTE : workaround for bug in mpegtsdemux since doesn't emit
                                                no-more-pad signal. this may cause wrong content attributes at PAUSED state
                                                this code should be removed after mpegtsdemux is fixed */
-                                               if ( g_strrstr(GST_OBJECT_NAME(factory), "mpegtsdemux") )
+                                               if (g_strrstr(GST_OBJECT_NAME(factory), "mpegtsdemux"))
                                                {
                                                        LOGW("force no-more-pad to TRUE since mpegtsdemux os not giving no-more-pad signal. content attributes may wrong");
                                                        player->no_more_pad = TRUE;
@@ -11844,15 +11844,15 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                                g_object_set(mainbin[MMPLAYER_M_DEMUX_EX].gst, "file-location", player->profile.uri,NULL);
                                        }
                                }
-                               else if(g_strrstr(klass, "Decoder") && __mmplayer_link_decoder(player,pad))
+                               else if (g_strrstr(klass, "Decoder") && __mmplayer_link_decoder(player,pad))
                                {
-                                       if(mainbin[MMPLAYER_M_DEC1].gst == NULL)
+                                       if (mainbin[MMPLAYER_M_DEC1].gst == NULL)
                                        {
                                                LOGD("plugged element is decoder. take it[MMPLAYER_M_DEC1]\n");
                                                mainbin[MMPLAYER_M_DEC1].id = MMPLAYER_M_DEC1;
                                                mainbin[MMPLAYER_M_DEC1].gst = new_element;
                                        }
-                                       else if(mainbin[MMPLAYER_M_DEC2].gst == NULL)
+                                       else if (mainbin[MMPLAYER_M_DEC2].gst == NULL)
                                        {
                                                LOGD("plugged element is decoder. take it[MMPLAYER_M_DEC2]\n");
                                                mainbin[MMPLAYER_M_DEC2].id = MMPLAYER_M_DEC2;
@@ -11863,7 +11863,7 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                         * before returning result of play start. And, missing plugin should be
                                         * updated here for multi track files.
                                         */
-                                       if(g_str_has_prefix(mime, "video"))
+                                       if (g_str_has_prefix(mime, "video"))
                                        {
                                                GstPad *src_pad = NULL;
                                                GstPadTemplate *pad_templ = NULL;
@@ -11874,15 +11874,15 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                                player->not_supported_codec &= MISSING_PLUGIN_AUDIO;
                                                player->can_support_codec |= FOUND_PLUGIN_VIDEO;
 
-                                               src_pad = gst_element_get_static_pad (new_element, "src");
-                                               pad_templ = gst_pad_get_pad_template (src_pad);
+                                               src_pad = gst_element_get_static_pad(new_element, "src");
+                                               pad_templ = gst_pad_get_pad_template(src_pad);
                                                caps = GST_PAD_TEMPLATE_CAPS(pad_templ);
 
                                                caps_str = gst_caps_to_string(caps);
 
                                                /* clean */
-                                               MMPLAYER_FREEIF( caps_str );
-                                               gst_object_unref (src_pad);
+                                               MMPLAYER_FREEIF(caps_str);
+                                               gst_object_unref(src_pad);
                                        }
                                        else if (g_str_has_prefix(mime, "audio"))
                                        {
@@ -11892,8 +11892,8 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
                                        }
                                }
 
-                               if ( ! __mmplayer_close_link(player, pad, new_element,
-                                                       name_template,gst_element_factory_get_static_pad_templates(factory)) )
+                               if (!__mmplayer_close_link(player, pad, new_element,
+                                                       name_template,gst_element_factory_get_static_pad_templates(factory)))
                                {
                                        MMPLAYER_FREEIF(name_template);
                                        if (player->keep_detecting_vcodec)
@@ -11923,14 +11923,14 @@ __mmplayer_try_to_plug(mm_player_t* player, GstPad *pad, const GstCaps *caps) //
 
 ERROR:
        /* release */
-       if ( queue )
-               gst_object_unref( queue );
+       if (queue)
+               gst_object_unref(queue);
 
-       if ( queue_pad )
-               gst_object_unref( queue_pad );
+       if (queue_pad)
+               gst_object_unref(queue_pad);
 
-       if ( element )
-               gst_object_unref ( element );
+       if (element)
+               gst_object_unref(element);
 
        return FALSE;
 }
@@ -11942,36 +11942,36 @@ __mmplayer_check_not_supported_codec(mm_player_t* player, const gchar* factory_c
        MMPLAYER_FENTER();
 
        MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( mime, MM_ERROR_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(mime, MM_ERROR_INVALID_ARGUMENT);
 
-       LOGD("class : %s, mime : %s \n", factory_class, mime );
+       LOGD("class : %s, mime : %s \n", factory_class, mime);
 
        /* add missing plugin */
        /* NOTE : msl should check missing plugin for image mime type.
         * Some motion jpeg clips can have playable audio track.
         * So, msl have to play audio after displaying popup written video format not supported.
         */
-       if ( !( player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst ) )
+       if (!(player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst))
        {
-               if ( !( player->can_support_codec | player->videodec_linked | player->audiodec_linked ) )
+               if (!(player->can_support_codec | player->videodec_linked | player->audiodec_linked))
                {
                        LOGD("not found demuxer\n");
                        player->not_found_demuxer = TRUE;
-                       player->unlinked_demuxer_mime = g_strdup_printf ( "%s", mime );
+                       player->unlinked_demuxer_mime = g_strdup_printf("%s", mime);
 
                        goto DONE;
                }
        }
 
-       if!g_strrstr(factory_class, "Demuxer"))
+       if (!g_strrstr(factory_class, "Demuxer"))
        {
-               if( ( g_str_has_prefix(mime, "video") ) ||( g_str_has_prefix(mime, "image") ) )
+               if ((g_str_has_prefix(mime, "video")) || (g_str_has_prefix(mime, "image")))
                {
                        LOGD("can support codec=%d, vdec_linked=%d, adec_linked=%d\n",
                                player->can_support_codec, player->videodec_linked, player->audiodec_linked);
 
                        /* check that clip have multi tracks or not */
-                       if ( ( player->can_support_codec & FOUND_PLUGIN_VIDEO ) && ( player->videodec_linked ) )
+                       if ((player->can_support_codec & FOUND_PLUGIN_VIDEO) && (player->videodec_linked))
                        {
                                LOGD("video plugin is already linked\n");
                        }
@@ -11981,9 +11981,9 @@ __mmplayer_check_not_supported_codec(mm_player_t* player, const gchar* factory_c
                                player->not_supported_codec |= MISSING_PLUGIN_VIDEO;
                        }
                }
-               else if ( g_str_has_prefix(mime, "audio") )
+               else if (g_str_has_prefix(mime, "audio"))
                {
-                       if ( ( player->can_support_codec & FOUND_PLUGIN_AUDIO ) && ( player->audiodec_linked ) )
+                       if ((player->can_support_codec & FOUND_PLUGIN_AUDIO) && (player->audiodec_linked))
                        {
                                LOGD("audio plugin is already linked\n");
                        }
@@ -12009,14 +12009,14 @@ __mmplayer_pipeline_complete(GstElement *decodebin,  gpointer data)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        /* remove fakesink. */
-       if ( !__mmplayer_gst_remove_fakesink( player,
-                               &player->pipeline->mainbin[MMPLAYER_M_SRC_FAKESINK]) )
+       if (!__mmplayer_gst_remove_fakesink(player,
+                               &player->pipeline->mainbin[MMPLAYER_M_SRC_FAKESINK]))
        {
                /* NOTE : __mmplayer_pipeline_complete() can be called several time. because
-                * signaling mechanism ( pad-added, no-more-pad, new-decoded-pad ) from various
+                * signaling mechanism(pad-added, no-more-pad, new-decoded-pad) from various
                 * source element are not same. To overcome this situation, this function will called
                 * several places and several times. Therefore, this is not an error case.
                 */
@@ -12025,14 +12025,14 @@ __mmplayer_pipeline_complete(GstElement *decodebin,  gpointer data)
 
        LOGD("pipeline has completely constructed\n");
 
-       if (( player->ini.async_start ) &&
-               ( player->msg_posted == FALSE ) &&
-               ( player->cmd >= MMPLAYER_COMMAND_START ))
+       if ((player->ini.async_start) &&
+               (player->msg_posted == FALSE) &&
+               (player->cmd >= MMPLAYER_COMMAND_START))
        {
-               __mmplayer_handle_missed_plugin( player );
+               __mmplayer_handle_missed_plugin(player);
        }
 
-       MMPLAYER_GENERATE_DOT_IF_ENABLED ( player, "pipeline-status-complete" );
+       MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-complete");
 }
 
 static gboolean
@@ -12059,7 +12059,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
        }
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("fail to get attributes.\n");
                goto ERROR;
@@ -12076,7 +12076,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
        }
 #endif
 
-       if (mm_attrs_get_int_by_name (attrs, "pd_mode", &mode) == MM_ERROR_NONE)
+       if (mm_attrs_get_int_by_name(attrs, "pd_mode", &mode) == MM_ERROR_NONE)
        {
                if (mode == TRUE)
                {
@@ -12114,7 +12114,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
 
        LOGD("repeat count = %d, num_of_list = %d\n", count, num_of_list);
 
-       if ( num_of_list == 0 )
+       if (num_of_list == 0)
        {
                if (mm_attrs_get_string_by_name(player->attrs, "profile_uri", &uri) != MM_ERROR_NONE)
                {
@@ -12137,7 +12137,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
 
        uri_idx = player->uri_info.uri_idx;
 
-       while(TRUE)
+       while (TRUE)
        {
                check_cnt++;
 
@@ -12149,7 +12149,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
 
                LOGD("uri idx : %d / %d\n", uri_idx, num_of_list);
 
-               if ( uri_idx < num_of_list-1 )
+               if (uri_idx < num_of_list-1)
                {
                        uri_idx++;
                }
@@ -12160,7 +12160,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
                                LOGD("no repeat.");
                                goto ERROR;
                        }
-                       else if ( count > 1 )   /* decrease play count */
+                       else if (count > 1)     /* decrease play count */
                        {
                                /* we successeded to rewind. update play count and then wait for next EOS */
                                count--;
@@ -12168,7 +12168,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
                                mm_attrs_set_int_by_name(attrs, "profile_play_count", count);
 
                                /* commit attribute */
-                               if ( mmf_attrs_commit ( attrs ) )
+                               if (mmf_attrs_commit(attrs))
                                {
                                        LOGE("failed to commit attribute\n");
                                }
@@ -12196,7 +12196,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
                if ((profile.uri_type != MM_PLAYER_URI_TYPE_FILE) &&
                        (profile.uri_type != MM_PLAYER_URI_TYPE_URL_HTTP))
                {
-                       LOGW("uri type is not supported (%d).", profile.uri_type);
+                       LOGW("uri type is not supported(%d).", profile.uri_type);
                        continue;
                }
 
@@ -12212,7 +12212,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player)
                goto ERROR;
        }
 
-       LOGD("next uri %s (%d)\n", uri, uri_idx);
+       LOGD("next uri %s(%d)\n", uri, uri_idx);
 
        return TRUE;
 
@@ -12278,7 +12278,7 @@ __mmplayer_initialize_next_play(mm_player_t *player)
        if (player->parsers)
        {
                GList *parsers = player->parsers;
-               for ( ;parsers ; parsers = g_list_next(parsers))
+               for (;parsers ; parsers = g_list_next(parsers))
                {
                        gchar *name = parsers->data;
                        MMPLAYER_FREEIF(name);
@@ -12291,7 +12291,7 @@ __mmplayer_initialize_next_play(mm_player_t *player)
        if (player->audio_decoders)
        {
                GList *a_dec = player->audio_decoders;
-               for ( ;a_dec ; a_dec = g_list_next(a_dec))
+               for (;a_dec ; a_dec = g_list_next(a_dec))
                {
                        gchar *name = a_dec->data;
                        MMPLAYER_FREEIF(name);
@@ -12327,7 +12327,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
        msg_param.code = MM_ERROR_PLAYER_INTERNAL;
 
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
        {
                LOGE("fail to get attributes.\n");
                goto ERROR;
@@ -12354,7 +12354,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
        }
 
        /* setup source */
-       switch ( player->profile.uri_type )
+       switch (player->profile.uri_type)
        {
                /* file source */
                case MM_PLAYER_URI_TYPE_FILE:
@@ -12363,7 +12363,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
 
                        element = gst_element_factory_make("filesrc", "source");
 
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create filesrc\n");
                                break;
@@ -12380,7 +12380,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
                        cookie_list = NULL;
 
                        element = gst_element_factory_make(player->ini.httpsrc_element, "http_streaming_source");
-                       if ( !element )
+                       if (!element)
                        {
                                LOGE("failed to create http streaming source element[%s].\n", player->ini.httpsrc_element);
                                break;
@@ -12388,10 +12388,10 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
                        LOGD("using http streamming source [%s].\n", player->ini.httpsrc_element);
 
                        /* get attribute */
-                       mm_attrs_get_string_by_name ( attrs, "streaming_cookie", &cookies );
-                       mm_attrs_get_string_by_name ( attrs, "streaming_user_agent", &user_agent );
-                       mm_attrs_get_string_by_name ( attrs, "streaming_proxy", &proxy );
-                       mm_attrs_get_int_by_name ( attrs, "streaming_timeout", &http_timeout );
+                       mm_attrs_get_string_by_name(attrs, "streaming_cookie", &cookies);
+                       mm_attrs_get_string_by_name(attrs, "streaming_user_agent", &user_agent);
+                       mm_attrs_get_string_by_name(attrs, "streaming_proxy", &proxy);
+                       mm_attrs_get_int_by_name(attrs, "streaming_timeout", &http_timeout);
 
                        if ((http_timeout == DEFAULT_HTTP_TIMEOUT) &&
                                (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT))
@@ -12413,12 +12413,12 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
                        g_object_set(G_OBJECT(element), "blocksize", (unsigned long)(64*1024), NULL);
 
                        /* check if prosy is vailid or not */
-                       if ( util_check_valid_url ( proxy ) )
+                       if (util_check_valid_url(proxy))
                                g_object_set(G_OBJECT(element), "proxy", proxy, NULL);
                        /* parsing cookies */
-                       if ( ( cookie_list = util_get_cookie_list ((const char*)cookies) ) )
+                       if ((cookie_list = util_get_cookie_list((const char*)cookies)))
                                g_object_set(G_OBJECT(element), "cookies", cookie_list, NULL);
-                       if ( user_agent )
+                       if (user_agent)
                                g_object_set(G_OBJECT(element), "user_agent", user_agent, NULL);
                        break;
                }
@@ -12427,7 +12427,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
                        break;
        }
 
-       if ( !element )
+       if (!element)
        {
                LOGE("no source element was created.\n");
                goto ERROR;
@@ -12457,8 +12457,8 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
 
                elemId = MMPLAYER_M_TYPEFIND;
                element = gst_element_factory_make("typefind", "typefinder");
-               MMPLAYER_SIGNAL_CONNECT( player, element, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type",
-                       G_CALLBACK(__mmplayer_typefind_have_type), (gpointer)player );
+               MMPLAYER_SIGNAL_CONNECT(player, element, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "have-type",
+                       G_CALLBACK(__mmplayer_typefind_have_type), (gpointer)player);
        }
        else
        {
@@ -12467,9 +12467,9 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
        }
 
        /* check autoplug element is OK */
-       if ( ! element )
+       if (!element)
        {
-               LOGE("can not create element (%d)\n", elemId);
+               LOGE("can not create element(%d)\n", elemId);
                goto ERROR;
        }
 
@@ -12484,13 +12484,13 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
        mainbin[elemId].id = elemId;
        mainbin[elemId].gst = element;
 
-       if ( gst_element_link (mainbin[MMPLAYER_M_SRC].gst, mainbin[elemId].gst) == FALSE )
+       if (gst_element_link(mainbin[MMPLAYER_M_SRC].gst, mainbin[elemId].gst) == FALSE)
        {
-               LOGE("Failed to link src - autoplug (or typefind)\n");
+               LOGE("Failed to link src - autoplug(or typefind)\n");
                goto ERROR;
        }
 
-       if (gst_element_set_state (mainbin[MMPLAYER_M_SRC].gst, target) == GST_STATE_CHANGE_FAILURE)
+       if (gst_element_set_state(mainbin[MMPLAYER_M_SRC].gst, target) == GST_STATE_CHANGE_FAILURE)
        {
                LOGE("Failed to change state of src element\n");
                goto ERROR;
@@ -12498,7 +12498,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
 
        if (!MMPLAYER_IS_HTTP_STREAMING(player))
        {
-               if (gst_element_set_state (mainbin[MMPLAYER_M_AUTOPLUG].gst, target) == GST_STATE_CHANGE_FAILURE)
+               if (gst_element_set_state(mainbin[MMPLAYER_M_AUTOPLUG].gst, target) == GST_STATE_CHANGE_FAILURE)
                {
                        LOGE("Failed to change state of decodebin\n");
                        goto ERROR;
@@ -12506,7 +12506,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
        }
        else
        {
-               if (gst_element_set_state (mainbin[MMPLAYER_M_TYPEFIND].gst, target) == GST_STATE_CHANGE_FAILURE)
+               if (gst_element_set_state(mainbin[MMPLAYER_M_TYPEFIND].gst, target) == GST_STATE_CHANGE_FAILURE)
                {
                        LOGE("Failed to change state of src element\n");
                        goto ERROR;
@@ -12544,7 +12544,7 @@ __mmplayer_deactivate_selector(mm_player_t *player, MMPlayerTrackType type)
        gboolean send_notice = FALSE;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        LOGD("type %d", type);
 
@@ -12579,7 +12579,7 @@ __mmplayer_deactivate_selector(mm_player_t *player, MMPlayerTrackType type)
                srcpad = gst_element_get_static_pad(player->pipeline->mainbin[selectorId].gst, "src");
 
                if (selector->event_probe_id != 0)
-                       gst_pad_remove_probe (srcpad, selector->event_probe_id);
+                       gst_pad_remove_probe(srcpad, selector->event_probe_id);
                selector->event_probe_id = 0;
 
                if ((sinkbin) && (sinkbin[sinkId].gst))
@@ -12590,21 +12590,21 @@ __mmplayer_deactivate_selector(mm_player_t *player, MMPlayerTrackType type)
                        {
                                /* after getting drained signal there is no data flows, so no need to do pad_block */
                                LOGD("unlink %s:%s, %s:%s", GST_DEBUG_PAD_NAME(srcpad), GST_DEBUG_PAD_NAME(sinkpad));
-                               gst_pad_unlink (srcpad, sinkpad);
+                               gst_pad_unlink(srcpad, sinkpad);
 
                                /* send custom event to sink pad to handle it at video sink */
                                if (send_notice) {
                                        LOGD("send custom event to sinkpad");
-                                       GstStructure *s = gst_structure_new_empty ("application/flush-buffer");
-                                       GstEvent *event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s);
-                                       gst_pad_send_event (sinkpad, event);
+                                       GstStructure *s = gst_structure_new_empty("application/flush-buffer");
+                                       GstEvent *event = gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM, s);
+                                       gst_pad_send_event(sinkpad, event);
                                }
                        }
 
-                       gst_object_unref (sinkpad);
+                       gst_object_unref(sinkpad);
                        sinkpad = NULL;
                }
-               gst_object_unref (srcpad);
+               gst_object_unref(srcpad);
                srcpad = NULL;
 
                LOGD("selector release");
@@ -12612,13 +12612,13 @@ __mmplayer_deactivate_selector(mm_player_t *player, MMPlayerTrackType type)
                /* release and unref requests pad from the selector */
                for (n = 0; n < selector->channels->len; n++)
                {
-                       GstPad *sinkpad = g_ptr_array_index (selector->channels, n);
-                       gst_element_release_request_pad ((player->pipeline->mainbin[selectorId].gst), sinkpad);
+                       GstPad *sinkpad = g_ptr_array_index(selector->channels, n);
+                       gst_element_release_request_pad((player->pipeline->mainbin[selectorId].gst), sinkpad);
                }
-               g_ptr_array_set_size (selector->channels, 0);
+               g_ptr_array_set_size(selector->channels, 0);
 
-               gst_element_set_state (player->pipeline->mainbin[selectorId].gst, GST_STATE_NULL);
-               gst_bin_remove (GST_BIN_CAST (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), player->pipeline->mainbin[selectorId].gst);
+               gst_element_set_state(player->pipeline->mainbin[selectorId].gst, GST_STATE_NULL);
+               gst_bin_remove(GST_BIN_CAST(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), player->pipeline->mainbin[selectorId].gst);
 
                player->pipeline->mainbin[selectorId].gst = NULL;
                selector = NULL;
@@ -12631,7 +12631,7 @@ static void
 __mmplayer_deactivate_old_path(mm_player_t *player)
 {
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        if ((!__mmplayer_deactivate_selector(player, MM_PLAYER_TRACK_TYPE_AUDIO)) ||
                (!__mmplayer_deactivate_selector(player, MM_PLAYER_TRACK_TYPE_VIDEO)) ||
@@ -12642,17 +12642,17 @@ __mmplayer_deactivate_old_path(mm_player_t *player)
        }
 
        _mmplayer_track_destroy(player);
-       __mmplayer_release_signal_connection( player, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG );
+       __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG);
 
        if (player->streamer)
        {
-               __mm_player_streaming_deinitialize (player->streamer);
+               __mm_player_streaming_deinitialize(player->streamer);
                __mm_player_streaming_destroy(player->streamer);
                player->streamer = NULL;
        }
 
        MMPLAYER_PLAYBACK_LOCK(player);
-       g_cond_signal( &player->next_play_thread_cond );
+       g_cond_signal(&player->next_play_thread_cond);
 
        MMPLAYER_FLEAVE();
        return;
@@ -12679,7 +12679,7 @@ int _mmplayer_set_file_buffering_path(MMHandleType hplayer, const char* file_pat
        mm_player_t* player = (mm_player_t*) hplayer;
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (file_path) {
                player->http_file_buffering_path = (gchar*)file_path;
@@ -12695,7 +12695,7 @@ int _mmplayer_set_uri(MMHandleType hplayer, const char* uri)
        mm_player_t* player = (mm_player_t*) hplayer;
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        mm_attrs_set_string_by_name(player->attrs, "profile_uri", uri);
        if (mmf_attrs_commit(player->attrs))
@@ -12722,8 +12722,8 @@ int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL (uri, MM_ERROR_INVALID_ARGUMENT);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(uri, MM_ERROR_INVALID_ARGUMENT);
 
        if (player->pipeline && player->pipeline->textbin)
        {
@@ -12757,7 +12757,7 @@ int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_
                {
                        char *original_uri = NULL;
 
-                       if ( attrs )
+                       if (attrs)
                        {
                                mm_attrs_get_string_by_name(attrs, "profile_uri", &original_uri);
 
@@ -12770,12 +12770,12 @@ int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_
                                player->uri_info.uri_list = g_list_append(player->uri_info.uri_list, g_strdup(original_uri));
                                player->uri_info.uri_idx = 0;
 
-                               LOGD("add original path at first : %s (%d)", original_uri);
+                               LOGD("add original path at first : %s(%d)", original_uri);
                        }
                }
 
                player->uri_info.uri_list = g_list_append(player->uri_info.uri_list, g_strdup(uri));
-               LOGD("add new path : %s (total num of list = %d)", uri, g_list_length(player->uri_info.uri_list));
+               LOGD("add new path : %s(total num of list = %d)", uri, g_list_length(player->uri_info.uri_list));
        }
 
        MMPLAYER_FLEAVE();
@@ -12789,7 +12789,7 @@ int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri)
        guint num_of_list = 0;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        num_of_list = g_list_length(player->uri_info.uri_list);
 
@@ -12797,7 +12797,7 @@ int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri)
        {
                gint uri_idx = player->uri_info.uri_idx;
 
-               if ( uri_idx < num_of_list-1 )
+               if (uri_idx < num_of_list-1)
                        uri_idx++;
                else
                        uri_idx = 0;
@@ -12821,17 +12821,17 @@ GstCaps *caps, gpointer data)
        const gchar* mime = NULL;
        gchar* caps_str = NULL;
 
-       klass = gst_element_factory_get_metadata (gst_element_get_factory(elem), GST_ELEMENT_METADATA_KLASS);
-       mime = gst_structure_get_name (gst_caps_get_structure(caps, 0));
+       klass = gst_element_factory_get_metadata(gst_element_get_factory(elem), GST_ELEMENT_METADATA_KLASS);
+       mime = gst_structure_get_name(gst_caps_get_structure(caps, 0));
        caps_str = gst_caps_to_string(caps);
 
        LOGW("unknown type of caps : %s from %s",
-                                       caps_str, GST_ELEMENT_NAME (elem));
+                                       caps_str, GST_ELEMENT_NAME(elem));
 
        MMPLAYER_FREEIF(caps_str);
 
        /* There is no available codec. */
-       __mmplayer_check_not_supported_codec (player, klass, mime);
+       __mmplayer_check_not_supported_codec(player, klass, mime);
 }
 
 static gboolean
@@ -12843,7 +12843,7 @@ GstCaps * caps,  gpointer data)
        gboolean ret = TRUE;
 
        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
-       mime = gst_structure_get_name (gst_caps_get_structure(caps, 0));
+       mime = gst_structure_get_name(gst_caps_get_structure(caps, 0));
 
        if (g_str_has_prefix(mime, "audio")) {
                GstStructure* caps_structure = NULL;
@@ -12852,10 +12852,10 @@ GstCaps * caps,  gpointer data)
                gchar *caps_str = NULL;
 
                caps_structure = gst_caps_get_structure(caps, 0);
-               gst_structure_get_int (caps_structure, "rate", &samplerate);
-               gst_structure_get_int (caps_structure, "channels", &channels);
+               gst_structure_get_int(caps_structure, "rate", &samplerate);
+               gst_structure_get_int(caps_structure, "channels", &channels);
 
-               if ( (channels > 0 && samplerate == 0)) {
+               if ((channels > 0 && samplerate == 0)) {
                        LOGD("exclude audio...");
                        ret = FALSE;
                }
@@ -12865,12 +12865,12 @@ GstCaps * caps,  gpointer data)
                if (g_strrstr(caps_str, "mobile-xmf")) {
                        mm_attrs_set_string_by_name(player->attrs, "content_audio_codec", "mobile-xmf");
                }
-               MMPLAYER_FREEIF (caps_str);
+               MMPLAYER_FREEIF(caps_str);
        } else if (g_str_has_prefix(mime, "video") && !player->ini.video_playback_supported) {
                MMMessageParamType msg_param;
-               memset (&msg_param, 0, sizeof(MMMessageParamType));
+               memset(&msg_param, 0, sizeof(MMMessageParamType));
                msg_param.code = MM_ERROR_NOT_SUPPORT_API;
-               MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
                LOGD("video file is not supported on this device");
                ret = FALSE;
        } else if (g_str_has_prefix(mime, "video") && player->videodec_linked) {
@@ -12904,8 +12904,8 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
        gint idx = 0;
        int surface_type = 0;
 
-       factory_name = GST_OBJECT_NAME (factory);
-       klass = gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
+       factory_name = GST_OBJECT_NAME(factory);
+       klass = gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_KLASS);
        caps_str = gst_caps_to_string(caps);
 
        LOGD("found new element [%s] to link", factory_name);
@@ -12929,12 +12929,12 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
        }
 
        /* filtering exclude keyword */
-       for ( idx = 0; player->ini.exclude_element_keyword[idx][0] != '\0'; idx++ )
+       for (idx = 0; player->ini.exclude_element_keyword[idx][0] != '\0'; idx++)
        {
-               if ( strstr(factory_name, player->ini.exclude_element_keyword[idx] ) )
+               if (strstr(factory_name, player->ini.exclude_element_keyword[idx]))
                {
                        LOGW("skipping [%s] by exculde keyword [%s]\n",
-                       factory_name, player->ini.exclude_element_keyword[idx] );
+                       factory_name, player->ini.exclude_element_keyword[idx]);
 
                        // NOTE : does we need to check n_value against the number of item selected?
                        result = GST_AUTOPLUG_SELECT_SKIP;
@@ -12978,12 +12978,12 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                GstStructure* str = NULL;
                gint channels = 0;
 
-               str = gst_caps_get_structure( caps, 0 );
-               if ( str )
+               str = gst_caps_get_structure(caps, 0);
+               if (str)
                {
-                       gst_structure_get_int (str, "channels", &channels);
+                       gst_structure_get_int(str, "channels", &channels);
 
-                       LOGD ("check audio ch : %d %d\n", player->max_audio_channels, channels);
+                       LOGD("check audio ch : %d %d\n", player->max_audio_channels, channels);
                        if (player->max_audio_channels < channels)
                        {
                                player->max_audio_channels = channels;
@@ -12993,7 +12993,7 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                if (!player->audiodec_linked)
                {
                        /* set stream information */
-                       __mmplayer_set_audio_attrs (player, caps);
+                       __mmplayer_set_audio_attrs(player, caps);
                }
        }
        else if (g_strrstr(klass, "Codec/Decoder/Video"))
@@ -13012,7 +13012,7 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                                        if (_mmplayer_resource_manager_prepare(&player->resource_manager, RESOURCE_TYPE_VIDEO_DECODER)
                                                != MM_ERROR_NONE)
                                        {
-                                               LOGW ("could not prepare for video_decoder resource, skip it.");
+                                               LOGW("could not prepare for video_decoder resource, skip it.");
                                                result = GST_AUTOPLUG_SELECT_SKIP;
                                                goto DONE;
                                        }
@@ -13027,20 +13027,20 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                gint stype = 0;
                gint width = 0;
                GstStructure *str = NULL;
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &stype);
 
                /* don't make video because of not required */
                if ((stype == MM_DISPLAY_SURFACE_NULL) &&
                        (player->set_mode.media_packet_video_stream == FALSE))
                {
-                       LOGD ("no video because it's not required. -> return expose");
+                       LOGD("no video because it's not required. -> return expose");
                        result = GST_AUTOPLUG_SELECT_EXPOSE;
                        goto DONE;
                }
 
                /* get w/h for omx state-tune */
-               str = gst_caps_get_structure (caps, 0);
-               gst_structure_get_int (str, "width", &width);
+               str = gst_caps_get_structure(caps, 0);
+               gst_structure_get_int(str, "width", &width);
 
                if (width != 0) {
                        if (player->v_stream_caps) {
@@ -13049,7 +13049,7 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                        }
 
                        player->v_stream_caps = gst_caps_copy(caps);
-                       LOGD ("take caps for video state tune");
+                       LOGD("take caps for video state tune");
                        MMPLAYER_LOG_GST_CAPS_TYPE(player->v_stream_caps);
                }
        }
@@ -13057,7 +13057,7 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
        if (g_strrstr(klass, "Decoder"))
        {
                const char* mime = NULL;
-               mime = gst_structure_get_name (gst_caps_get_structure(caps, 0));
+               mime = gst_structure_get_name(gst_caps_get_structure(caps, 0));
 
                if (g_str_has_prefix(mime, "video"))
                {
@@ -13068,7 +13068,7 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
 
                        player->videodec_linked = 1;
                }
-               else if(g_str_has_prefix(mime, "audio"))
+               else if (g_str_has_prefix(mime, "audio"))
                {
                        player->not_supported_codec &= MISSING_PLUGIN_VIDEO;
                        player->can_support_codec |= FOUND_PLUGIN_AUDIO;
@@ -13114,7 +13114,7 @@ gpointer data) // @
                gchar* caps_str = NULL;
                caps_str = gst_caps_to_string(caps);
 
-               LOGD("pad removed caps : %s from %s", caps_str, GST_ELEMENT_NAME(elem) );
+               LOGD("pad removed caps : %s from %s", caps_str, GST_ELEMENT_NAME(elem));
 
                MMPLAYER_FREEIF(caps_str);
        }
@@ -13126,7 +13126,7 @@ __mmplayer_gst_decode_drained(GstElement *bin, gpointer data)
        mm_player_t* player = (mm_player_t*)data;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        LOGD("__mmplayer_gst_decode_drained");
 
@@ -13162,14 +13162,14 @@ __mmplayer_gst_decode_drained(GstElement *bin, gpointer data)
 }
 
 static void
-__mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer data)
+__mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data)
 {
        mm_player_t* player = (mm_player_t*)data;
        const gchar* klass = NULL;
        gchar* factory_name = NULL;
 
-       klass = gst_element_factory_get_metadata (gst_element_get_factory(element), GST_ELEMENT_METADATA_KLASS);
-       factory_name = GST_OBJECT_NAME (gst_element_get_factory(element));
+       klass = gst_element_factory_get_metadata(gst_element_get_factory(element), GST_ELEMENT_METADATA_KLASS);
+       factory_name = GST_OBJECT_NAME(gst_element_get_factory(element));
 
        LOGD("new elem klass: %s, factory_name: %s, new elem name : %s\n", klass, factory_name, GST_ELEMENT_NAME(element));
 
@@ -13180,8 +13180,8 @@ __mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer dat
        if (g_strrstr(klass, "Codec/Decoder/Audio"))
        {
                gchar* selected = NULL;
-               selected = g_strdup( GST_ELEMENT_NAME(element));
-               player->audio_decoders = g_list_append (player->audio_decoders, selected);
+               selected = g_strdup(GST_ELEMENT_NAME(element));
+               player->audio_decoders = g_list_append(player->audio_decoders, selected);
        }
        //-> temp code
 
@@ -13189,8 +13189,8 @@ __mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer dat
        {
                gchar* selected = NULL;
 
-               selected = g_strdup (factory_name);
-               player->parsers = g_list_append (player->parsers, selected);
+               selected = g_strdup(factory_name);
+               player->parsers = g_list_append(player->parsers, selected);
        }
 
        if ((g_strrstr(klass, "Demux") || g_strrstr(klass, "Parse")) && !(g_strrstr(klass, "Adaptive")))
@@ -13199,7 +13199,7 @@ __mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer dat
                 * than 1 demuxer/parser
                 */
 
-               //LOGD ("plugged element is demuxer. take it\n");
+               //LOGD("plugged element is demuxer. take it\n");
                player->pipeline->mainbin[MMPLAYER_M_DEMUX].id = MMPLAYER_M_DEMUX;
                player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst = element;
 
@@ -13215,31 +13215,31 @@ __mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer dat
        {
                int surface_type = 0;
 
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &surface_type);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
        }
 
        // to support trust-zone only
        if (g_strrstr(factory_name, "asfdemux"))
        {
-               LOGD ("set file-location %s\n", player->profile.uri);
-               g_object_set (G_OBJECT(element), "file-location", player->profile.uri, NULL);
+               LOGD("set file-location %s\n", player->profile.uri);
+               g_object_set(G_OBJECT(element), "file-location", player->profile.uri, NULL);
 
                if (player->video_hub_download_mode == TRUE)
                {
-                       g_object_set (G_OBJECT(element), "downloading-mode", player->video_hub_download_mode, NULL);
+                       g_object_set(G_OBJECT(element), "downloading-mode", player->video_hub_download_mode, NULL);
                }
        }
        else if (g_strrstr(factory_name, "legacyh264parse"))
        {
-               LOGD ("[%s] output-format to legacyh264parse\n", "mssdemux");
-               g_object_set (G_OBJECT(element), "output-format", 1, NULL); /* NALU/Byte Stream format */
+               LOGD("[%s] output-format to legacyh264parse\n", "mssdemux");
+               g_object_set(G_OBJECT(element), "output-format", 1, NULL); /* NALU/Byte Stream format */
        }
        else if (g_strrstr(factory_name, "mpegaudioparse"))
        {
                if ((MMPLAYER_IS_HTTP_STREAMING(player)) &&
                        (__mmplayer_is_only_mp3_type(player->type)))
                {
-                       LOGD ("[mpegaudioparse] set streaming pull mode.");
+                       LOGD("[mpegaudioparse] set streaming pull mode.");
                        g_object_set(G_OBJECT(element), "http-pull-mp3dec", TRUE, NULL);
                }
        }
@@ -13251,7 +13251,7 @@ __mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer dat
        if ((player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst) &&
                (g_strrstr(GST_ELEMENT_NAME(element), "multiqueue")))
        {
-               LOGD ("plugged element is multiqueue. take it\n");
+               LOGD("plugged element is multiqueue. take it\n");
 
                player->pipeline->mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].id = MMPLAYER_M_DEMUXED_S_BUFFER;
                player->pipeline->mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].gst = element;
@@ -13277,13 +13277,13 @@ __mmplayer_gst_element_added (GstElement *bin, GstElement *element, gpointer dat
 static gboolean __mmplayer_configure_audio_callback(mm_player_t* player)
 {
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
-       if ( MMPLAYER_IS_STREAMING(player) )
+       if (MMPLAYER_IS_STREAMING(player))
                return FALSE;
 
        /* This callback can be set to music player only. */
-       if((player->can_support_codec & 0x02) == FOUND_PLUGIN_VIDEO)
+       if ((player->can_support_codec & 0x02) == FOUND_PLUGIN_VIDEO)
        {
                LOGW("audio callback is not supported for video");
                return FALSE;
@@ -13294,17 +13294,17 @@ static gboolean __mmplayer_configure_audio_callback(mm_player_t* player)
                {
                        GstPad *pad = NULL;
 
-                       pad = gst_element_get_static_pad (player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "sink");
+                       pad = gst_element_get_static_pad(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "sink");
 
-                       if ( !pad )
+                       if (!pad)
                        {
                                LOGE("failed to get sink pad from audiosink to probe data\n");
                                return FALSE;
                        }
-                       player->audio_cb_probe_id = gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER,
+                       player->audio_cb_probe_id = gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_BUFFER,
                                __mmplayer_audio_stream_probe, player, NULL);
 
-                       gst_object_unref (pad);
+                       gst_object_unref(pad);
 
                        pad = NULL;
               }
@@ -13323,10 +13323,10 @@ static gboolean __mmplayer_configure_audio_callback(mm_player_t* player)
 static void
 __mmplayer_init_factories(mm_player_t* player) // @
 {
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        player->factories = gst_registry_feature_filter(gst_registry_get(),
-                                        (GstPluginFeatureFilter)__mmplayer_feature_filter, FALSE, NULL);
+                                       (GstPluginFeatureFilter)__mmplayer_feature_filter, FALSE, NULL);
        player->factories = g_list_sort(player->factories, (GCompareFunc)util_factory_rank_compare);
 }
 
@@ -13334,11 +13334,11 @@ static void
 __mmplayer_release_factories(mm_player_t* player) // @
 {
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        if (player->factories)
        {
-               gst_plugin_feature_list_free (player->factories);
+               gst_plugin_feature_list_free(player->factories);
                player->factories = NULL;
        }
 
@@ -13352,7 +13352,7 @@ __mmplayer_release_misc(mm_player_t* player)
        gboolean cur_mode = player->set_mode.rich_audio;
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        player->video_stream_cb = NULL;
        player->video_stream_cb_user_param = NULL;
@@ -13414,7 +13414,7 @@ __mmplayer_release_misc(mm_player_t* player)
                player->maximum_bitrate[i] = 0;
        }
 
-       /* remove media stream cb (appsrc cb) */
+       /* remove media stream cb(appsrc cb) */
        for (i = 0; i < MM_PLAYER_STREAM_TYPE_MAX; i++)
        {
                player->media_stream_buffer_status_cb[i] = NULL;
@@ -13441,7 +13441,7 @@ __mmplayer_release_misc_post(mm_player_t* player)
 
        /* player->pipeline is already released before. */
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0);
        mm_attrs_set_int_by_name(player->attrs, "content_audio_found", 0);
@@ -13450,7 +13450,7 @@ __mmplayer_release_misc_post(mm_player_t* player)
        if (player->parsers)
        {
                GList *parsers = player->parsers;
-               for ( ;parsers ; parsers = g_list_next(parsers))
+               for (;parsers ; parsers = g_list_next(parsers))
                {
                        gchar *name = parsers->data;
                        MMPLAYER_FREEIF(name);
@@ -13463,7 +13463,7 @@ __mmplayer_release_misc_post(mm_player_t* player)
        if (player->audio_decoders)
        {
                GList *a_dec = player->audio_decoders;
-               for ( ;a_dec ; a_dec = g_list_next(a_dec))
+               for (;a_dec ; a_dec = g_list_next(a_dec))
                {
                        gchar *name = a_dec->data;
                        MMPLAYER_FREEIF(name);
@@ -13489,7 +13489,7 @@ __mmplayer_release_misc_post(mm_player_t* player)
                }
 
                GList *uri_list = player->uri_info.uri_list;
-               for ( ;uri_list ; uri_list = g_list_next(uri_list))
+               for (;uri_list ; uri_list = g_list_next(uri_list))
                {
                        gchar *uri = uri_list->data;
                        MMPLAYER_FREEIF(uri);
@@ -13516,39 +13516,39 @@ static GstElement *__mmplayer_element_create_and_link(mm_player_t *player, GstPa
        LOGD("creating %s to plug\n", name);
 
        element = gst_element_factory_make(name, NULL);
-       if ( ! element )
+       if (!element)
        {
                LOGE("failed to create queue\n");
                return NULL;
        }
 
-       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state(element, GST_STATE_READY) )
+       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(element, GST_STATE_READY))
        {
                LOGE("failed to set state READY to %s\n", name);
-               gst_object_unref (element);
+               gst_object_unref(element);
                return NULL;
        }
 
-       if ( ! gst_bin_add(GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), element))
+       if (!gst_bin_add(GST_BIN(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst), element))
        {
                LOGE("failed to add %s\n", name);
-               gst_object_unref (element);
+               gst_object_unref(element);
                return NULL;
        }
 
        sinkpad = gst_element_get_static_pad(element, "sink");
 
-       if ( GST_PAD_LINK_OK != gst_pad_link(pad, sinkpad) )
+       if (GST_PAD_LINK_OK != gst_pad_link(pad, sinkpad))
        {
                LOGE("failed to link %s\n", name);
-               gst_object_unref (sinkpad);
-               gst_object_unref (element);
+               gst_object_unref(sinkpad);
+               gst_object_unref(element);
                return NULL;
        }
 
        LOGD("linked %s to pipeline successfully\n", name);
 
-       gst_object_unref (sinkpad);
+       gst_object_unref(sinkpad);
 
        return element;
 }
@@ -13576,27 +13576,27 @@ const char *padname, const GList *templlist)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player &&
+       MMPLAYER_RETURN_VAL_IF_FAIL(player &&
                player->pipeline &&
                player->pipeline->mainbin,
-               FALSE );
+               FALSE);
 
        mainbin = player->pipeline->mainbin;
 
        LOGD("plugging pad %s:%s to newly create %s:%s\n",
-                       GST_ELEMENT_NAME( GST_PAD_PARENT ( srcpad ) ),
-                       GST_PAD_NAME( srcpad ),
-                       GST_ELEMENT_NAME( sinkelement ),
+                       GST_ELEMENT_NAME(GST_PAD_PARENT(srcpad)),
+                       GST_PAD_NAME(srcpad),
+                       GST_ELEMENT_NAME(sinkelement),
                        padname);
 
        factory = gst_element_get_factory(sinkelement);
-       klass = gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
+       klass = gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_KLASS);
 
        /* check if player can do start continually */
        MMPLAYER_CHECK_CMD_IF_EXIT(player);
 
        /* need it to warm up omx before linking to pipeline */
-       if (g_strrstr(GST_ELEMENT_NAME( GST_PAD_PARENT ( srcpad ) ), "demux"))
+       if (g_strrstr(GST_ELEMENT_NAME(GST_PAD_PARENT(srcpad)), "demux"))
        {
                LOGD("get demux caps.\n");
                if (player->state_tune_caps)
@@ -13628,9 +13628,9 @@ const char *padname, const GList *templlist)
                player->state_tune_caps = NULL;
        }
 
-       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state(sinkelement, target_state) )
+       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(sinkelement, target_state))
        {
-               LOGE("failed to set %d state to %s\n", target_state, GST_ELEMENT_NAME( sinkelement ));
+               LOGE("failed to set %d state to %s\n", target_state, GST_ELEMENT_NAME(sinkelement));
                if (isvideo_decoder)
                {
                        gst_element_set_state(sinkelement, GST_STATE_NULL);
@@ -13641,9 +13641,9 @@ const char *padname, const GList *templlist)
        }
 
        /* add to pipeline */
-       if ( ! gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), sinkelement) )
+       if (!gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), sinkelement))
        {
-               LOGE("failed to add %s to mainbin\n", GST_ELEMENT_NAME( sinkelement ));
+               LOGE("failed to add %s to mainbin\n", GST_ELEMENT_NAME(sinkelement));
                goto ERROR;
        }
 
@@ -13651,9 +13651,9 @@ const char *padname, const GList *templlist)
 
        /* added to support multi track files */
        /* only decoder case and any of the video/audio still need to link*/
-       if(g_strrstr(klass, "Decoder") && __mmplayer_link_decoder(player,srcpad))
+       if (g_strrstr(klass, "Decoder") && __mmplayer_link_decoder(player,srcpad))
        {
-               gchar *name = g_strdup(GST_ELEMENT_NAME( GST_PAD_PARENT ( srcpad )));
+               gchar *name = g_strdup(GST_ELEMENT_NAME(GST_PAD_PARENT(srcpad)));
 
                if (g_strrstr(name, "mpegtsdemux")|| g_strrstr(name, "mssdemux"))
                {
@@ -13690,7 +13690,7 @@ const char *padname, const GList *templlist)
                                parser = __mmplayer_element_create_and_link(player, srcpad, needed_parser);
                                MMPLAYER_FREEIF(needed_parser);
 
-                               if ( !parser )
+                               if (!parser)
                                {
                                        LOGE("failed to create parser\n");
                                }
@@ -13698,7 +13698,7 @@ const char *padname, const GList *templlist)
                                {
                                        if (smooth_streaming)
                                        {
-                                               g_object_set (parser, "output-format", 1, NULL); /* NALU/Byte Stream format */
+                                               g_object_set(parser, "output-format", 1, NULL); /* NALU/Byte Stream format */
                                        }
 
                                        /* update srcpad if parser is created */
@@ -13710,7 +13710,7 @@ const char *padname, const GList *templlist)
                MMPLAYER_FREEIF(name);
 
                queue = __mmplayer_element_create_and_link(player, srcpad, "queue"); // parser - queue or demuxer - queue
-               if ( ! queue )
+               if (!queue)
                {
                        LOGE("failed to create queue\n");
                        goto ERROR;
@@ -13723,39 +13723,39 @@ const char *padname, const GList *templlist)
                q_max_size_time = GST_QUEUE_DEFAULT_TIME;
 
                /* assigning queue handle for futher manipulation purpose */
-               /* FIXIT : make it some kind of list so that msl can support more then two stream (text, data, etc...) */
-               if(mainbin[MMPLAYER_M_Q1].gst == NULL)
+               /* FIXIT : make it some kind of list so that msl can support more then two stream(text, data, etc...) */
+               if (mainbin[MMPLAYER_M_Q1].gst == NULL)
                {
                        mainbin[MMPLAYER_M_Q1].id = MMPLAYER_M_Q1;
                        mainbin[MMPLAYER_M_Q1].gst = queue;
 
                        if (player->profile.uri_type == MM_PLAYER_URI_TYPE_SS)
                        {
-                               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q1].gst), "max-size-time", 0 , NULL);
-                               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q1].gst), "max-size-buffers", 2, NULL);
-                               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q1].gst), "max-size-bytes", 0, NULL);
+                               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q1].gst), "max-size-time", 0 , NULL);
+                               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q1].gst), "max-size-buffers", 2, NULL);
+                               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q1].gst), "max-size-bytes", 0, NULL);
                        }
                        else
                        {
                                if (!MMPLAYER_IS_RTSP_STREAMING(player))
-                                       g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q1].gst), "max-size-time", q_max_size_time * GST_SECOND, NULL);
+                                       g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q1].gst), "max-size-time", q_max_size_time * GST_SECOND, NULL);
                        }
                }
-               else if(mainbin[MMPLAYER_M_Q2].gst == NULL)
+               else if (mainbin[MMPLAYER_M_Q2].gst == NULL)
                {
                        mainbin[MMPLAYER_M_Q2].id = MMPLAYER_M_Q2;
                        mainbin[MMPLAYER_M_Q2].gst = queue;
 
                        if (player->profile.uri_type == MM_PLAYER_URI_TYPE_SS)
                        {
-                               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q2].gst), "max-size-time", 0 , NULL);
-                               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q2].gst), "max-size-buffers", 2, NULL);
-                               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q2].gst), "max-size-bytes", 0, NULL);
+                               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q2].gst), "max-size-time", 0 , NULL);
+                               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q2].gst), "max-size-buffers", 2, NULL);
+                               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q2].gst), "max-size-bytes", 0, NULL);
                        }
                        else
                        {
                                if (!MMPLAYER_IS_RTSP_STREAMING(player))
-                                       g_object_set (G_OBJECT (mainbin[MMPLAYER_M_Q2].gst), "max-size-time", q_max_size_time * GST_SECOND, NULL);
+                                       g_object_set(G_OBJECT(mainbin[MMPLAYER_M_Q2].gst), "max-size-time", q_max_size_time * GST_SECOND, NULL);
                        }
                }
                else
@@ -13766,16 +13766,16 @@ const char *padname, const GList *templlist)
 
                pad = gst_element_get_static_pad(sinkelement, padname);
 
-               if ( ! pad )
+               if (!pad)
                {
                        LOGW("failed to get pad(%s) from %s. retrying with [sink]\n",
-                               padname, GST_ELEMENT_NAME(sinkelement) );
+                               padname, GST_ELEMENT_NAME(sinkelement));
 
                        pad = gst_element_get_static_pad(sinkelement, "sink");
-                       if ( ! pad )
+                       if (!pad)
                        {
                                LOGE("failed to get pad(sink) from %s. \n",
-                               GST_ELEMENT_NAME(sinkelement) );
+                               GST_ELEMENT_NAME(sinkelement));
                                goto ERROR;
                        }
                }
@@ -13784,23 +13784,23 @@ const char *padname, const GList *templlist)
                const gchar *mime_type = NULL;
                {
                        srccaps = gst_pad_query_caps(srcpad, NULL);
-                       if ( !srccaps )
+                       if (!srccaps)
                                goto ERROR;
 
-                       str = gst_caps_get_structure( srccaps, 0 );
-                       if ( ! str )
+                       str = gst_caps_get_structure(srccaps, 0);
+                       if (!str)
                                goto ERROR;
 
                        mime_type = gst_structure_get_name(str);
-                       if ( ! mime_type )
+                       if (!mime_type)
                                goto ERROR;
                }
 
                /* link queue and decoder. so, it will be queue - decoder. */
-               if ( GST_PAD_LINK_OK != gst_pad_link(srcpad, pad) )
+               if (GST_PAD_LINK_OK != gst_pad_link(srcpad, pad))
                {
                        gst_object_unref(GST_OBJECT(pad));
-                       LOGE("failed to link (%s) to pad(%s)\n", GST_ELEMENT_NAME( sinkelement ), padname );
+                       LOGE("failed to link(%s) to pad(%s)\n", GST_ELEMENT_NAME(sinkelement), padname);
 
                        /* reconstitute supportable codec */
                        if (strstr(mime_type, "video"))
@@ -13831,33 +13831,33 @@ const char *padname, const GList *templlist)
                srccaps = NULL;
        }
 
-       if ( !MMPLAYER_IS_HTTP_PD(player) )
+       if (!MMPLAYER_IS_HTTP_PD(player))
        {
-               if( (g_strrstr(klass, "Demux") && !g_strrstr(klass, "Metadata")) || (g_strrstr(klass, "Parser") ) )
+               if ((g_strrstr(klass, "Demux") && !g_strrstr(klass, "Metadata")) || (g_strrstr(klass, "Parser")))
                {
                        if (MMPLAYER_IS_HTTP_STREAMING(player))
                        {
                                gint64 dur_bytes = 0L;
                                muxed_buffer_type_e type = MUXED_BUFFER_TYPE_MEM_QUEUE;
 
-                               if ( !mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst)
+                               if (!mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst)
                                {
                                        LOGD("creating http streaming buffering queue\n");
 
                                        queue = gst_element_factory_make("queue2", "queue2");
-                                       if ( ! queue )
+                                       if (!queue)
                                        {
-                                               LOGE ( "failed to create buffering queue element\n" );
+                                               LOGE("failed to create buffering queue element\n");
                                                goto ERROR;
                                        }
 
-                                       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_READY) )
+                                       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_READY))
                                        {
                                                LOGE("failed to set state READY to buffering queue\n");
                                                goto ERROR;
                                        }
 
-                                       if ( !gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue) )
+                                       if (!gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue))
                                        {
                                                LOGE("failed to add buffering queue\n");
                                                goto ERROR;
@@ -13866,7 +13866,7 @@ const char *padname, const GList *templlist)
                                        qsinkpad = gst_element_get_static_pad(queue, "sink");
                                        qsrcpad = gst_element_get_static_pad(queue, "src");
 
-                                       if ( GST_PAD_LINK_OK != gst_pad_link(srcpad, qsinkpad) )
+                                       if (GST_PAD_LINK_OK != gst_pad_link(srcpad, qsinkpad))
                                        {
                                                LOGE("failed to link buffering queue\n");
                                                goto ERROR;
@@ -13877,9 +13877,9 @@ const char *padname, const GList *templlist)
                                        mainbin[MMPLAYER_M_MUXED_S_BUFFER].id = MMPLAYER_M_MUXED_S_BUFFER;
                                        mainbin[MMPLAYER_M_MUXED_S_BUFFER].gst = queue;
 
-                                       if ( !MMPLAYER_IS_HTTP_LIVE_STREAMING(player))
+                                       if (!MMPLAYER_IS_HTTP_LIVE_STREAMING(player))
                                        {
-                                               if ( !gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
+                                               if (!gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, GST_FORMAT_BYTES, &dur_bytes))
                                                        LOGE("fail to get duration.\n");
 
                                                if (dur_bytes > 0) {
@@ -13896,7 +13896,7 @@ const char *padname, const GList *templlist)
                                        }
 
                                        /* NOTE : we cannot get any duration info from ts container in case of streaming */
-                                       if(!g_strrstr(GST_ELEMENT_NAME(sinkelement), "mpegtsdemux"))
+                                       if (!g_strrstr(GST_ELEMENT_NAME(sinkelement), "mpegtsdemux"))
                                        {
                                                __mm_player_streaming_set_queue2(player->streamer,
                                                        queue,
@@ -13915,46 +13915,46 @@ const char *padname, const GList *templlist)
        }
        /* if it is not decoder or */
        /* in decoder case any of the video/audio still need to link*/
-       if(!g_strrstr(klass, "Decoder"))
+       if (!g_strrstr(klass, "Decoder"))
        {
 
                pad = gst_element_get_static_pad(sinkelement, padname);
-               if ( ! pad )
+               if (!pad)
                {
                        LOGW("failed to get pad(%s) from %s. retrying with [sink]\n",
-                                       padname, GST_ELEMENT_NAME(sinkelement) );
+                                       padname, GST_ELEMENT_NAME(sinkelement));
 
                        pad = gst_element_get_static_pad(sinkelement, "sink");
 
-                       if ( ! pad )
+                       if (!pad)
                        {
                                LOGE("failed to get pad(sink) from %s. \n",
-                                       GST_ELEMENT_NAME(sinkelement) );
+                                       GST_ELEMENT_NAME(sinkelement));
                                goto ERROR;
                        }
                }
 
-               if ( GST_PAD_LINK_OK != gst_pad_link(srcpad, pad) )
+               if (GST_PAD_LINK_OK != gst_pad_link(srcpad, pad))
                {
                        gst_object_unref(GST_OBJECT(pad));
-                       LOGE("failed to link (%s) to pad(%s)\n", GST_ELEMENT_NAME( sinkelement ), padname );
+                       LOGE("failed to link(%s) to pad(%s)\n", GST_ELEMENT_NAME(sinkelement), padname);
                        goto ERROR;
                }
 
                gst_object_unref(GST_OBJECT(pad));
        }
 
-       for(;templlist != NULL; templlist = templlist->next)
+       for (;templlist != NULL; templlist = templlist->next)
        {
                padtemplate = templlist->data;
 
-               LOGD ("director = [%d], presence = [%d]\n", padtemplate->direction, padtemplate->presence);
+               LOGD("director = [%d], presence = [%d]\n", padtemplate->direction, padtemplate->presence);
 
-               if    padtemplate->direction != GST_PAD_SRC ||
+               if (    padtemplate->direction != GST_PAD_SRC ||
                        padtemplate->presence == GST_PAD_REQUEST        )
                        continue;
 
-               switch(padtemplate->presence)
+               switch (padtemplate->presence)
                {
                        case GST_PAD_ALWAYS:
                        {
@@ -13962,20 +13962,20 @@ const char *padname, const GList *templlist)
                                GstCaps *caps = gst_pad_query_caps(srcpad, NULL);
 
                                /* Check whether caps has many types */
-                               if ( !gst_caps_is_fixed(caps))
+                               if (!gst_caps_is_fixed(caps))
                                {
-                                       LOGD ("always pad but, caps has many types");
+                                       LOGD("always pad but, caps has many types");
                                        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
                                        has_many_types = TRUE;
                                        break;
                                }
 
-                               if ( ! __mmplayer_try_to_plug(player, srcpad, caps) )
+                               if (!__mmplayer_try_to_plug(player, srcpad, caps))
                                {
                                        gst_object_unref(GST_OBJECT(srcpad));
                                        gst_caps_unref(GST_CAPS(caps));
 
-                                       LOGE("failed to plug something after %s\n", GST_ELEMENT_NAME( sinkelement ));
+                                       LOGE("failed to plug something after %s\n", GST_ELEMENT_NAME(sinkelement));
                                        goto ERROR;
                                }
 
@@ -13998,18 +13998,18 @@ const char *padname, const GList *templlist)
        /* check if player can do start continually */
        MMPLAYER_CHECK_CMD_IF_EXIT(player);
 
-       if( has_dynamic_pads )
+       if (has_dynamic_pads)
        {
                player->have_dynamic_pad = TRUE;
-               MMPLAYER_SIGNAL_CONNECT ( player, sinkelement, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
+               MMPLAYER_SIGNAL_CONNECT(player, sinkelement, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
                        G_CALLBACK(__mmplayer_add_new_pad), player);
 
                /* for streaming, more then one typefind will used for each elementary stream
                 * so this doesn't mean the whole pipeline completion
                 */
-               if ( ! MMPLAYER_IS_RTSP_STREAMING( player ) )
+               if (!MMPLAYER_IS_RTSP_STREAMING(player))
                {
-                       MMPLAYER_SIGNAL_CONNECT( player, sinkelement, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
+                       MMPLAYER_SIGNAL_CONNECT(player, sinkelement, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "no-more-pads",
                                G_CALLBACK(__mmplayer_pipeline_complete), player);
                }
        }
@@ -14021,23 +14021,23 @@ const char *padname, const GList *templlist)
                player->has_many_types = has_many_types;
 
                pad = gst_element_get_static_pad(sinkelement, "src");
-               MMPLAYER_SIGNAL_CONNECT (player, pad, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "notify::caps", G_CALLBACK(__mmplayer_add_new_caps), player);
-               gst_object_unref (GST_OBJECT(pad));
+               MMPLAYER_SIGNAL_CONNECT(player, pad, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "notify::caps", G_CALLBACK(__mmplayer_add_new_caps), player);
+               gst_object_unref(GST_OBJECT(pad));
        }
 
 
        /* check if player can do start continually */
        MMPLAYER_CHECK_CMD_IF_EXIT(player);
 
-       if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state(sinkelement, GST_STATE_PAUSED) )
+       if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(sinkelement, GST_STATE_PAUSED))
        {
-               LOGE("failed to set state PAUSED to %s\n", GST_ELEMENT_NAME( sinkelement ));
+               LOGE("failed to set state PAUSED to %s\n", GST_ELEMENT_NAME(sinkelement));
                goto ERROR;
        }
 
-       if ( queue )
+       if (queue)
        {
-               if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state (queue, GST_STATE_PAUSED) )
+               if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(queue, GST_STATE_PAUSED))
                {
                        LOGE("failed to set state PAUSED to queue\n");
                        goto ERROR;
@@ -14045,13 +14045,13 @@ const char *padname, const GList *templlist)
 
                queue = NULL;
 
-               gst_object_unref (GST_OBJECT(qsrcpad));
+               gst_object_unref(GST_OBJECT(qsrcpad));
                qsrcpad = NULL;
        }
 
-       if ( parser )
+       if (parser)
        {
-               if ( GST_STATE_CHANGE_FAILURE == gst_element_set_state (parser, GST_STATE_PAUSED) )
+               if (GST_STATE_CHANGE_FAILURE == gst_element_set_state(parser, GST_STATE_PAUSED))
                {
                        LOGE("failed to set state PAUSED to queue\n");
                        goto ERROR;
@@ -14059,7 +14059,7 @@ const char *padname, const GList *templlist)
 
                parser = NULL;
 
-               gst_object_unref (GST_OBJECT(pssrcpad));
+               gst_object_unref(GST_OBJECT(pssrcpad));
                pssrcpad = NULL;
        }
 
@@ -14069,7 +14069,7 @@ const char *padname, const GList *templlist)
 
 ERROR:
 
-       if ( queue )
+       if (queue)
        {
                gst_object_unref(GST_OBJECT(qsrcpad));
 
@@ -14082,11 +14082,11 @@ ERROR:
                 * You need to let the parent manage the object instead of unreffing the object directly.
                 */
 
-               gst_bin_remove (GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue);
-               //gst_object_unref( queue );
+               gst_bin_remove(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), queue);
+               //gst_object_unref(queue);
        }
 
-       if ( srccaps )
+       if (srccaps)
                gst_caps_unref(GST_CAPS(srccaps));
 
     return FALSE;
@@ -14101,9 +14101,9 @@ static gboolean __mmplayer_feature_filter(GstPluginFeature *feature, gpointer da
                return FALSE;
 
        /* only parsers, demuxers and decoders */
-               klass = gst_element_factory_get_metadata (GST_ELEMENT_FACTORY(feature), GST_ELEMENT_METADATA_KLASS);
+               klass = gst_element_factory_get_metadata(GST_ELEMENT_FACTORY(feature), GST_ELEMENT_METADATA_KLASS);
 
-       ifg_strrstr(klass, "Demux") == NULL &&
+       if (g_strrstr(klass, "Demux") == NULL &&
                        g_strrstr(klass, "Codec/Decoder") == NULL &&
                        g_strrstr(klass, "Depayloader") == NULL &&
                        g_strrstr(klass, "Parse") == NULL)
@@ -14123,33 +14123,33 @@ static void   __mmplayer_add_new_caps(GstPad* pad, GParamSpec* unused, gpointer da
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( pad )
-       MMPLAYER_RETURN_IF_FAIL ( unused )
-       MMPLAYER_RETURN_IF_FAIL ( data )
+       MMPLAYER_RETURN_IF_FAIL(pad)
+       MMPLAYER_RETURN_IF_FAIL(unused)
+       MMPLAYER_RETURN_IF_FAIL(data)
 
        caps = gst_pad_query_caps(pad, NULL);
-       if ( !caps )
+       if (!caps)
                return;
 
        str = gst_caps_get_structure(caps, 0);
-       if ( !str )
+       if (!str)
                return;
 
        name = gst_structure_get_name(str);
-       if ( !name )
+       if (!name)
                return;
        LOGD("name=%s\n", name);
 
-       if ( ! __mmplayer_try_to_plug(player, pad, caps) )
+       if (!__mmplayer_try_to_plug(player, pad, caps))
        {
-               LOGE("failed to autoplug for type (%s)\n", name);
+               LOGE("failed to autoplug for type(%s)\n", name);
                gst_caps_unref(caps);
                return;
        }
 
        gst_caps_unref(caps);
 
-       __mmplayer_pipeline_complete( NULL, (gpointer)player );
+       __mmplayer_pipeline_complete(NULL, (gpointer)player);
 
        MMPLAYER_FLEAVE();
 
@@ -14165,15 +14165,15 @@ static void __mmplayer_set_unlinked_mime_type(mm_player_t* player, GstCaps *caps
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
-       MMPLAYER_RETURN_IF_FAIL ( caps );
+       MMPLAYER_RETURN_IF_FAIL(player);
+       MMPLAYER_RETURN_IF_FAIL(caps);
 
        str = gst_caps_get_structure(caps, 0);
-       if ( !str )
+       if (!str)
                return;
 
        stream_type = gst_structure_get_name(str);
-       if ( !stream_type )
+       if (!stream_type)
                return;
 
 
@@ -14182,18 +14182,18 @@ static void __mmplayer_set_unlinked_mime_type(mm_player_t* player, GstCaps *caps
        {
                if (g_str_has_prefix(stream_type, "video/mpeg"))
                {
-                       gst_structure_get_int (str, MM_PLAYER_MPEG_VNAME, &version);
+                       gst_structure_get_int(str, MM_PLAYER_MPEG_VNAME, &version);
                        version_field = MM_PLAYER_MPEG_VNAME;
                }
                else if (g_str_has_prefix(stream_type, "video/x-wmv"))
                {
-                       gst_structure_get_int (str, MM_PLAYER_WMV_VNAME, &version);
+                       gst_structure_get_int(str, MM_PLAYER_WMV_VNAME, &version);
                        version_field = MM_PLAYER_WMV_VNAME;
 
                }
                else if (g_str_has_prefix(stream_type, "video/x-divx"))
                {
-                       gst_structure_get_int (str, MM_PLAYER_DIVX_VNAME, &version);
+                       gst_structure_get_int(str, MM_PLAYER_DIVX_VNAME, &version);
                        version_field = MM_PLAYER_DIVX_VNAME;
                }
 
@@ -14210,12 +14210,12 @@ static void __mmplayer_set_unlinked_mime_type(mm_player_t* player, GstCaps *caps
        {
                if (g_str_has_prefix(stream_type, "audio/mpeg")) // mp3 or aac
                {
-                       gst_structure_get_int (str, MM_PLAYER_MPEG_VNAME, &version);
+                       gst_structure_get_int(str, MM_PLAYER_MPEG_VNAME, &version);
                        version_field = MM_PLAYER_MPEG_VNAME;
                }
                else if (g_str_has_prefix(stream_type, "audio/x-wma"))
                {
-                       gst_structure_get_int (str, MM_PLAYER_WMA_VNAME, &version);
+                       gst_structure_get_int(str, MM_PLAYER_WMA_VNAME, &version);
                        version_field = MM_PLAYER_WMA_VNAME;
                }
 
@@ -14240,28 +14240,28 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
        const char *name;
 
        MMPLAYER_FENTER();
-       MMPLAYER_RETURN_IF_FAIL ( player );
-       MMPLAYER_RETURN_IF_FAIL ( pad );
+       MMPLAYER_RETURN_IF_FAIL(player);
+       MMPLAYER_RETURN_IF_FAIL(pad);
 
-       GST_OBJECT_LOCK (pad);
+       GST_OBJECT_LOCK(pad);
        if ((caps = gst_pad_get_current_caps(pad)))
                gst_caps_ref(caps);
-       GST_OBJECT_UNLOCK (pad);
+       GST_OBJECT_UNLOCK(pad);
 
-       if ( NULL == caps )
+       if (NULL == caps)
        {
                caps = gst_pad_query_caps(pad, NULL);
-               if ( !caps ) return;
+               if (!caps) return;
        }
 
        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
 
        str = gst_caps_get_structure(caps, 0);
-       if ( !str )
+       if (!str)
                return;
 
        name = gst_structure_get_name(str);
-       if ( !name )
+       if (!name)
                return;
 
        player->num_dynamic_pad++;
@@ -14297,10 +14297,10 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
 
                /* set stream information */
                /* if possible, set it here because the caps is not distrubed by resampler. */
-               gst_structure_get_int (str, "rate", &samplerate);
+               gst_structure_get_int(str, "rate", &samplerate);
                mm_attrs_set_int_by_name(player->attrs, "content_audio_samplerate", samplerate);
 
-               gst_structure_get_int (str, "channels", &channels);
+               gst_structure_get_int(str, "channels", &channels);
                mm_attrs_set_int_by_name(player->attrs, "content_audio_channels", channels);
 
                LOGD("audio samplerate : %d     channels : %d", samplerate, channels);
@@ -14308,7 +14308,7 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
        else if (g_strrstr(name, "video"))
        {
                gint stype;
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &stype);
 
                /* don't make video because of not required */
                if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE)
@@ -14320,9 +14320,9 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
                player->v_stream_caps = gst_caps_copy(caps); //if needed, video caps is required when videobin is created
        }
 
-       if ( ! __mmplayer_try_to_plug(player, pad, caps) )
+       if (!__mmplayer_try_to_plug(player, pad, caps))
        {
-               LOGE("failed to autoplug for type (%s)", name);
+               LOGE("failed to autoplug for type(%s)", name);
 
                __mmplayer_set_unlinked_mime_type(player, caps);
        }
@@ -14334,25 +14334,25 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
 }
 
 gboolean
-__mmplayer_check_subtitle( mm_player_t* player )
+__mmplayer_check_subtitle(mm_player_t* player)
 {
        MMHandleType attrs = 0;
        char *subtitle_uri = NULL;
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        /* get subtitle attribute */
        attrs = MMPLAYER_GET_ATTRS(player);
-       if ( !attrs )
+       if (!attrs)
                return FALSE;
 
        mm_attrs_get_string_by_name(attrs, "subtitle_uri", &subtitle_uri);
-       if ( !subtitle_uri || !strlen(subtitle_uri))
+       if (!subtitle_uri || !strlen(subtitle_uri))
                return FALSE;
 
-       LOGD ("subtite uri is %s[%d]\n", subtitle_uri, strlen(subtitle_uri));
+       LOGD("subtite uri is %s[%d]\n", subtitle_uri, strlen(subtitle_uri));
        player->is_external_subtitle_present = TRUE;
 
        MMPLAYER_FLEAVE();
@@ -14361,12 +14361,12 @@ __mmplayer_check_subtitle( mm_player_t* player )
 }
 
 static gboolean
-__mmplayer_can_extract_pcm( mm_player_t* player )
+__mmplayer_can_extract_pcm(mm_player_t* player)
 {
        MMHandleType attrs = 0;
        gboolean sound_extraction = FALSE;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        attrs = MMPLAYER_GET_ATTRS(player);
        if (!attrs)
@@ -14388,7 +14388,7 @@ __mmplayer_can_extract_pcm( mm_player_t* player )
 }
 
 static gboolean
-__mmplayer_handle_streaming_error  ( mm_player_t* player, GstMessage * message )
+__mmplayer_handle_streaming_error (mm_player_t* player, GstMessage * message)
 {
        LOGD("\n");
        MMMessageParamType msg_param;
@@ -14399,16 +14399,16 @@ __mmplayer_handle_streaming_error  ( mm_player_t* player, GstMessage * message )
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( message, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(message, FALSE);
 
-       s = malloc( sizeof(GstStructure) );
-       memcpy ( s, gst_message_get_structure ( message ), sizeof(GstStructure));
+       s = malloc(sizeof(GstStructure));
+       memcpy(s, gst_message_get_structure(message), sizeof(GstStructure));
 
-       if ( !gst_structure_get_uint (s, "error_id", &error_id) )
+       if (!gst_structure_get_uint(s, "error_id", &error_id))
                error_id = MMPLAYER_STREAMING_ERROR_NONE;
 
-       switch ( error_id )
+       switch (error_id)
        {
                case MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO:
                        msg_param.code = MM_ERROR_PLAYER_STREAMING_UNSUPPORTED_AUDIO;
@@ -14552,22 +14552,22 @@ __mmplayer_handle_streaming_error  ( mm_player_t* player, GstMessage * message )
                        }
        }
 
-       error_string = g_strdup(gst_structure_get_string (s, "error_string"));
-       if ( error_string )
+       error_string = g_strdup(gst_structure_get_string(s, "error_string"));
+       if (error_string)
                msg_param.data = (void *) error_string;
 
-       if ( message->src )
+       if (message->src)
        {
-               msg_src_element = GST_ELEMENT_NAME( GST_ELEMENT_CAST( message->src ) );
+               msg_src_element = GST_ELEMENT_NAME(GST_ELEMENT_CAST(message->src));
 
                LOGE("-Msg src : [%s] Code : [%x] Error : [%s]  \n",
-                       msg_src_element, msg_param.code, (char*)msg_param.data );
+                       msg_src_element, msg_param.code, (char*)msg_param.data);
        }
 
        /* post error to application */
-       if ( ! player->msg_posted )
+       if (!player->msg_posted)
        {
-               MMPLAYER_POST_MSG( player, MM_MESSAGE_ERROR, &msg_param );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
 
                /* don't post more if one was sent already */
                player->msg_posted = TRUE;
@@ -14586,50 +14586,50 @@ __mmplayer_handle_streaming_error  ( mm_player_t* player, GstMessage * message )
 }
 
 static void
-__mmplayer_handle_eos_delay( mm_player_t* player, int delay_in_ms )
+__mmplayer_handle_eos_delay(mm_player_t* player, int delay_in_ms)
 {
-       MMPLAYER_RETURN_IF_FAIL( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
 
        /* post now if delay is zero */
-       if ( delay_in_ms == 0 || player->set_mode.pcm_extraction)
+       if (delay_in_ms == 0 || player->set_mode.pcm_extraction)
        {
                LOGD("eos delay is zero. posting EOS now\n");
-               MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_END_OF_STREAM, NULL);
 
-               if ( player->set_mode.pcm_extraction )
+               if (player->set_mode.pcm_extraction)
                        __mmplayer_cancel_eos_timer(player);
 
                return;
        }
 
        /* cancel if existing */
-       __mmplayer_cancel_eos_timer( player );
+       __mmplayer_cancel_eos_timer(player);
 
        /* init new timeout */
        /* NOTE : consider give high priority to this timer */
        LOGD("posting EOS message after [%d] msec\n", delay_in_ms);
 
-       player->eos_timer = g_timeout_add( delay_in_ms,
-               __mmplayer_eos_timer_cb, player );
+       player->eos_timer = g_timeout_add(delay_in_ms,
+               __mmplayer_eos_timer_cb, player);
 
-       player->context.global_default = g_main_context_default ();
+       player->context.global_default = g_main_context_default();
        LOGD("global default context = %p, eos timer id = %d", player->context.global_default, player->eos_timer);
 
        /* check timer is valid. if not, send EOS now */
-       if ( player->eos_timer == 0 )
+       if (player->eos_timer == 0)
        {
                LOGW("creating timer for delayed EOS has failed. sending EOS now\n");
-               MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_END_OF_STREAM, NULL);
        }
 }
 
 static void
-__mmplayer_cancel_eos_timer( mm_player_t* player )
+__mmplayer_cancel_eos_timer(mm_player_t* player)
 {
-       MMPLAYER_RETURN_IF_FAIL( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
-       if ( player->eos_timer )
+       if (player->eos_timer)
        {
                LOGD("cancel eos timer");
                __mmplayer_remove_g_source_from_context(player->context.global_default, player->eos_timer);
@@ -14645,12 +14645,12 @@ __mmplayer_eos_timer_cb(gpointer u_data)
        mm_player_t* player = NULL;
        player = (mm_player_t*) u_data;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
-       if ( player->play_count > 1 )
+       if (player->play_count > 1)
        {
                gint ret_value = 0;
-               ret_value = __gst_set_position( player, MM_PLAYER_POS_FORMAT_TIME, 0, TRUE);
+               ret_value = __gst_set_position(player, MM_PLAYER_POS_FORMAT_TIME, 0, TRUE);
                if (ret_value == MM_ERROR_NONE)
                {
                        MMHandleType attrs = 0;
@@ -14660,7 +14660,7 @@ __mmplayer_eos_timer_cb(gpointer u_data)
                        player->play_count--;
 
                        mm_attrs_set_int_by_name(attrs, "profile_play_count", player->play_count);
-                       mmf_attrs_commit ( attrs );
+                       mmf_attrs_commit(attrs);
                }
                else
                {
@@ -14670,7 +14670,7 @@ __mmplayer_eos_timer_cb(gpointer u_data)
        else
        {
                /* posting eos */
-               MMPLAYER_POST_MSG( player, MM_MESSAGE_END_OF_STREAM, NULL );
+               MMPLAYER_POST_MSG(player, MM_MESSAGE_END_OF_STREAM, NULL);
        }
 
        /* we are returning FALSE as we need only one posting */
@@ -14678,7 +14678,7 @@ __mmplayer_eos_timer_cb(gpointer u_data)
 }
 
 static gboolean
-__mmplayer_link_decoder( mm_player_t* player, GstPad *srcpad)
+__mmplayer_link_decoder(mm_player_t* player, GstPad *srcpad)
 {
        const gchar* name = NULL;
        GstStructure* str = NULL;
@@ -14686,25 +14686,25 @@ __mmplayer_link_decoder( mm_player_t* player, GstPad *srcpad)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( srcpad, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(srcpad, FALSE);
 
-       /* to check any of the decoder (video/audio) need to be linked  to parser*/
-       srccaps = gst_pad_query_caps( srcpad, NULL);
-       if ( !srccaps )
+       /* to check any of the decoder(video/audio) need to be linked  to parser*/
+       srccaps = gst_pad_query_caps(srcpad, NULL);
+       if (!srccaps)
                goto ERROR;
 
-       str = gst_caps_get_structure( srccaps, 0 );
-       if ( ! str )
+       str = gst_caps_get_structure(srccaps, 0);
+       if (!str)
                goto ERROR;
 
        name = gst_structure_get_name(str);
-       if ( ! name )
+       if (!name)
                goto ERROR;
 
        if (strstr(name, "video"))
        {
-               if(player->videodec_linked)
+               if (player->videodec_linked)
                {
                    LOGI("Video decoder already linked\n");
                        return FALSE;
@@ -14712,28 +14712,28 @@ __mmplayer_link_decoder( mm_player_t* player, GstPad *srcpad)
        }
        if (strstr(name, "audio"))
        {
-               if(player->audiodec_linked)
+               if (player->audiodec_linked)
                {
                    LOGI("Audio decoder already linked\n");
                        return FALSE;
                }
        }
 
-       gst_caps_unref( srccaps );
+       gst_caps_unref(srccaps);
 
        MMPLAYER_FLEAVE();
 
        return TRUE;
 
 ERROR:
-       if ( srccaps )
-               gst_caps_unref( srccaps );
+       if (srccaps)
+               gst_caps_unref(srccaps);
 
        return FALSE;
 }
 
 static gboolean
-__mmplayer_link_sink( mm_player_t* player , GstPad *srcpad)
+__mmplayer_link_sink(mm_player_t* player , GstPad *srcpad)
 {
        const gchar* name = NULL;
        GstStructure* str = NULL;
@@ -14741,25 +14741,25 @@ __mmplayer_link_sink( mm_player_t* player , GstPad *srcpad)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( srcpad, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(srcpad, FALSE);
 
-       /* to check any of the decoder (video/audio) need to be linked  to parser*/
-       srccaps = gst_pad_query_caps( srcpad, NULL );
-       if ( !srccaps )
+       /* to check any of the decoder(video/audio) need to be linked   to parser*/
+       srccaps = gst_pad_query_caps(srcpad, NULL);
+       if (!srccaps)
                goto ERROR;
 
-       str = gst_caps_get_structure( srccaps, 0 );
-       if ( ! str )
+       str = gst_caps_get_structure(srccaps, 0);
+       if (!str)
                goto ERROR;
 
        name = gst_structure_get_name(str);
-       if ( ! name )
+       if (!name)
                goto ERROR;
 
        if (strstr(name, "video"))
        {
-               if(player->videosink_linked)
+               if (player->videosink_linked)
                {
                        LOGI("Video Sink already linked\n");
                        return FALSE;
@@ -14767,7 +14767,7 @@ __mmplayer_link_sink( mm_player_t* player , GstPad *srcpad)
        }
        if (strstr(name, "audio"))
        {
-               if(player->audiosink_linked)
+               if (player->audiosink_linked)
                {
                        LOGI("Audio Sink already linked\n");
                        return FALSE;
@@ -14775,23 +14775,23 @@ __mmplayer_link_sink( mm_player_t* player , GstPad *srcpad)
        }
        if (strstr(name, "text"))
        {
-               if(player->textsink_linked)
+               if (player->textsink_linked)
                {
                        LOGI("Text Sink already linked\n");
                        return FALSE;
                }
        }
 
-       gst_caps_unref( srccaps );
+       gst_caps_unref(srccaps);
 
        MMPLAYER_FLEAVE();
 
        return TRUE;
-       //return (!player->videosink_linked || !player->audiosink_linked);
+       //return(!player->videosink_linked || !player->audiosink_linked);
 
 ERROR:
-       if ( srccaps )
-               gst_caps_unref( srccaps );
+       if (srccaps)
+               gst_caps_unref(srccaps);
 
        return FALSE;
 }
@@ -14799,33 +14799,33 @@ ERROR:
 
 /* sending event to one of sinkelements */
 static gboolean
-__gst_send_event_to_sink( mm_player_t* player, GstEvent* event )
+__gst_send_event_to_sink(mm_player_t* player, GstEvent* event)
 {
        GstEvent * event2 = NULL;
        GList *sinks = NULL;
        gboolean res = FALSE;
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( event, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(event, FALSE);
 
-       if ( player->play_subtitle && !player->use_textoverlay)
+       if (player->play_subtitle && !player->use_textoverlay)
                event2 = gst_event_copy((const GstEvent *)event);
 
        sinks = player->sink_elements;
        while (sinks)
        {
-               GstElement *sink = GST_ELEMENT_CAST (sinks->data);
+               GstElement *sink = GST_ELEMENT_CAST(sinks->data);
 
                if (GST_IS_ELEMENT(sink))
                {
                        /* keep ref to the event */
-                       gst_event_ref (event);
+                       gst_event_ref(event);
 
-                       if ( (res = gst_element_send_event (sink, event)) )
+                       if ((res = gst_element_send_event(sink, event)))
                        {
                                LOGD("sending event[%s] to sink element [%s] success!\n",
-                                       GST_EVENT_TYPE_NAME(event), GST_ELEMENT_NAME(sink) );
+                                       GST_EVENT_TYPE_NAME(event), GST_ELEMENT_NAME(sink));
 
                                /* rtsp case, asyn_done is not called after seek during pause state */
                                if (MMPLAYER_IS_RTSP_STREAMING(player))
@@ -14836,15 +14836,15 @@ __gst_send_event_to_sink( mm_player_t* player, GstEvent* event )
                                                {
                                                        LOGD("RTSP seek completed, after pause state..\n");
                                                        player->doing_seek = FALSE;
-                                                       MMPLAYER_POST_MSG ( player, MM_MESSAGE_SEEK_COMPLETED, NULL );
+                                                       MMPLAYER_POST_MSG(player, MM_MESSAGE_SEEK_COMPLETED, NULL);
                                                }
 
                                        }
                                }
 
-                               ifMMPLAYER_IS_MS_BUFF_SRC(player))
+                               if (MMPLAYER_IS_MS_BUFF_SRC(player))
                                {
-                                       sinks = g_list_next (sinks);
+                                       sinks = g_list_next(sinks);
                                        continue;
                                }
                                else
@@ -14852,10 +14852,10 @@ __gst_send_event_to_sink( mm_player_t* player, GstEvent* event )
                        }
 
                        LOGD("sending event[%s] to sink element [%s] failed. try with next one.\n",
-                               GST_EVENT_TYPE_NAME(event), GST_ELEMENT_NAME(sink) );
+                               GST_EVENT_TYPE_NAME(event), GST_ELEMENT_NAME(sink));
                }
 
-               sinks = g_list_next (sinks);
+               sinks = g_list_next(sinks);
        }
 
 #if 0
@@ -14868,31 +14868,31 @@ __gst_send_event_to_sink( mm_player_t* player, GstEvent* event )
        /* Note : Textbin is not linked to the video or audio bin.
         * It needs to send the event to the text sink seperatelly.
         */
-        if ( player->play_subtitle && !player->use_textoverlay)
+        if (player->play_subtitle && !player->use_textoverlay)
         {
-               GstElement *text_sink = GST_ELEMENT_CAST (player->pipeline->textbin[MMPLAYER_T_FAKE_SINK].gst);
+               GstElement *text_sink = GST_ELEMENT_CAST(player->pipeline->textbin[MMPLAYER_T_FAKE_SINK].gst);
 
                if (GST_IS_ELEMENT(text_sink))
                {
                        /* keep ref to the event */
-                       gst_event_ref (event2);
+                       gst_event_ref(event2);
 
-                       if ((res = gst_element_send_event (text_sink, event2)))
+                       if ((res = gst_element_send_event(text_sink, event2)))
                        {
                                LOGD("sending event[%s] to subtitle sink element [%s] success!\n",
-                                       GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink) );
+                                       GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink));
                        }
                        else
                        {
                                LOGE("sending event[%s] to subtitle sink element [%s] failed!\n",
-                                       GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink) );
+                                       GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink));
                        }
 
-                       gst_event_unref (event2);
+                       gst_event_unref(event2);
                }
         }
 
-       gst_event_unref (event);
+       gst_event_unref(event);
 
        MMPLAYER_FLEAVE();
 
@@ -14900,12 +14900,12 @@ __gst_send_event_to_sink( mm_player_t* player, GstEvent* event )
 }
 
 static void
-__mmplayer_add_sink( mm_player_t* player, GstElement* sink )
+__mmplayer_add_sink(mm_player_t* player, GstElement* sink)
 {
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
-       MMPLAYER_RETURN_IF_FAIL ( sink );
+       MMPLAYER_RETURN_IF_FAIL(player);
+       MMPLAYER_RETURN_IF_FAIL(sink);
 
        player->sink_elements =
                g_list_append(player->sink_elements, sink);
@@ -14914,12 +14914,12 @@ __mmplayer_add_sink( mm_player_t* player, GstElement* sink )
 }
 
 static void
-__mmplayer_del_sink( mm_player_t* player, GstElement* sink )
+__mmplayer_del_sink(mm_player_t* player, GstElement* sink)
 {
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
-       MMPLAYER_RETURN_IF_FAIL ( sink );
+       MMPLAYER_RETURN_IF_FAIL(player);
+       MMPLAYER_RETURN_IF_FAIL(sink);
 
        player->sink_elements =
                        g_list_remove(player->sink_elements, sink);
@@ -14930,22 +14930,22 @@ __mmplayer_del_sink( mm_player_t* player, GstElement* sink )
 static gboolean
 __gst_seek(mm_player_t* player, GstElement * element, gdouble rate,
                        GstFormat format, GstSeekFlags flags, GstSeekType cur_type,
-                       gint64 cur, GstSeekType stop_type, gint64 stop )
+                       gint64 cur, GstSeekType stop_type, gint64 stop)
 {
        GstEvent* event = NULL;
        gboolean result = FALSE;
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
-       if ( player->pipeline && player->pipeline->textbin)
+       if (player->pipeline && player->pipeline->textbin)
                __mmplayer_drop_subtitle(player, FALSE);
 
-       event = gst_event_new_seek (rate, format, flags, cur_type,
+       event = gst_event_new_seek(rate, format, flags, cur_type,
                cur, stop_type, stop);
 
-       result = __gst_send_event_to_sink( player, event );
+       result = __gst_send_event_to_sink(player, event);
 
        MMPLAYER_FLEAVE();
 
@@ -14966,8 +14966,8 @@ __gst_seek(mm_player_t* player, GstElement * element, gdouble rate,
  * with future versions of GObject by checking that the signal handler is still
  * connected before disconnected it:
  *
- *  if (g_signal_handler_is_connected (instance, id))
- *    g_signal_handler_disconnect (instance, id);
+ *  if (g_signal_handler_is_connected(instance, id))
+ *    g_signal_handler_disconnect(instance, id);
  */
 static void
 __mmplayer_release_signal_connection(mm_player_t* player, MMPlayerSignalType type)
@@ -14977,38 +14977,38 @@ __mmplayer_release_signal_connection(mm_player_t* player, MMPlayerSignalType typ
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_IF_FAIL( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        LOGD("release signals type : %d", type);
 
        if ((type < MM_PLAYER_SIGNAL_TYPE_AUTOPLUG) || (type >= MM_PLAYER_SIGNAL_TYPE_ALL))
        {
-               __mmplayer_release_signal_connection (player, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG);
-               __mmplayer_release_signal_connection (player, MM_PLAYER_SIGNAL_TYPE_VIDEOBIN);
-               __mmplayer_release_signal_connection (player, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN);
-               __mmplayer_release_signal_connection (player, MM_PLAYER_SIGNAL_TYPE_TEXTBIN);
-               __mmplayer_release_signal_connection (player, MM_PLAYER_SIGNAL_TYPE_OTHERS);
+               __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUTOPLUG);
+               __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_VIDEOBIN);
+               __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_AUDIOBIN);
+               __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_TEXTBIN);
+               __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_OTHERS);
                return;
        }
 
        sig_list = player->signals[type];
 
-       for ( ; sig_list; sig_list = sig_list->next )
+       for (; sig_list; sig_list = sig_list->next)
        {
                item = sig_list->data;
 
-               if ( item && item->obj && GST_IS_ELEMENT(item->obj) )
+               if (item && item->obj && GST_IS_ELEMENT(item->obj))
                {
-                       if ( g_signal_handler_is_connected ( item->obj, item->sig ) )
+                       if (g_signal_handler_is_connected(item->obj, item->sig))
                        {
-                               g_signal_handler_disconnect ( item->obj, item->sig );
+                               g_signal_handler_disconnect(item->obj, item->sig);
                        }
                }
 
-               MMPLAYER_FREEIF( item );
+               MMPLAYER_FREEIF(item);
        }
 
-       g_list_free ( player->signals[type] );
+       g_list_free(player->signals[type]);
        player->signals[type] = NULL;
 
        MMPLAYER_FLEAVE();
@@ -15044,8 +15044,8 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
        /* load previous attributes */
        if (player->attrs)
        {
-               mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &prev_display_surface_type);
-               mm_attrs_get_data_by_name (player->attrs, "display_overlay", &prev_display_overlay);
+               mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &prev_display_surface_type);
+               mm_attrs_get_data_by_name(player->attrs, "display_overlay", &prev_display_overlay);
                LOGD("[0: Video surface, 1: EVAS surface] previous surface type(%d), new surface type(%d)", prev_display_surface_type, surface_type);
                if (prev_display_surface_type == surface_type)
                {
@@ -15063,15 +15063,15 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
 
        /* check videosink element is created */
        if (!player->pipeline || !player->pipeline->videobin ||
-               !player->pipeline->videobin[MMPLAYER_V_SINK].gst )
+               !player->pipeline->videobin[MMPLAYER_V_SINK].gst)
        {
                LOGD("videosink element is not yet ready");
 
                /* videobin is not created yet, so we just set attributes related to display surface */
                LOGD("store display attribute for given surface type(%d)", surface_type);
-               mm_attrs_set_int_by_name (player->attrs, "display_surface_type", surface_type);
-               mm_attrs_set_data_by_name (player->attrs, "display_overlay", display_overlay, sizeof(display_overlay));
-               if ( mmf_attrs_commit ( player->attrs ) )
+               mm_attrs_set_int_by_name(player->attrs, "display_surface_type", surface_type);
+               mm_attrs_set_data_by_name(player->attrs, "display_overlay", display_overlay, sizeof(display_overlay));
+               if (mmf_attrs_commit(player->attrs))
                {
                        LOGE("failed to commit attribute");
                        MMPLAYER_FLEAVE();
@@ -15083,7 +15083,7 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
        else
        {
                /* get player command status */
-               if ( !(player->cmd == MMPLAYER_COMMAND_START || player->cmd == MMPLAYER_COMMAND_RESUME || player->cmd == MMPLAYER_COMMAND_PAUSE) )
+               if (!(player->cmd == MMPLAYER_COMMAND_START || player->cmd == MMPLAYER_COMMAND_RESUME || player->cmd == MMPLAYER_COMMAND_PAUSE))
                {
                        LOGE("invalid player command status(%d), __mmplayer_do_change_videosink() is only available with START/RESUME/PAUSE command",player->cmd);
                        MMPLAYER_FLEAVE();
@@ -15094,18 +15094,18 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
                cur_videosink_name = GST_ELEMENT_NAME(player->pipeline->videobin[MMPLAYER_V_SINK].gst);
 
                /* surface change */
-               for ( i = 0 ; i < num_of_dec ; i++)
+               for (i = 0 ; i < num_of_dec ; i++)
                {
-                       if ( player->pipeline->mainbin &&
-                               player->pipeline->mainbin[MMPLAYER_M_DEC1+i].gst )
+                       if (player->pipeline->mainbin &&
+                               player->pipeline->mainbin[MMPLAYER_M_DEC1+i].gst)
                        {
                                GstElementFactory *decfactory;
-                               decfactory = gst_element_get_factory (player->pipeline->mainbin[MMPLAYER_M_DEC1+i].gst);
+                               decfactory = gst_element_get_factory(player->pipeline->mainbin[MMPLAYER_M_DEC1+i].gst);
 
-                               klass = gst_element_factory_get_metadata (decfactory, GST_ELEMENT_METADATA_KLASS);
+                               klass = gst_element_factory_get_metadata(decfactory, GST_ELEMENT_METADATA_KLASS);
                                if ((g_strrstr(klass, "Codec/Decoder/Video")))
                                {
-                                       if ( !strncmp(cur_videosink_name, "x", 1) && (surface_type == MM_DISPLAY_SURFACE_EVAS) )
+                                       if (!strncmp(cur_videosink_name, "x", 1) && (surface_type == MM_DISPLAY_SURFACE_EVAS))
                                        {
                                                ret = __mmplayer_do_change_videosink(player, MMPLAYER_M_DEC1+i, player->ini.videosink_element_evas, surface_type, display_overlay);
                                                if (ret)
@@ -15119,7 +15119,7 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
                                                        return MM_ERROR_NONE;
                                                }
                                        }
-                                       else if (!strncmp(cur_videosink_name, "evas", 4) && (surface_type == MM_DISPLAY_SURFACE_OVERLAY) )
+                                       else if (!strncmp(cur_videosink_name, "evas", 4) && (surface_type == MM_DISPLAY_SURFACE_OVERLAY))
                                        {
                                                ret = __mmplayer_do_change_videosink(player, MMPLAYER_M_DEC1+i, player->ini.videosink_element_overlay, surface_type, display_overlay);
                                                if (ret)
@@ -15146,9 +15146,9 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
 
 ERROR_CASE:
        /* rollback to previous attributes */
-       mm_attrs_set_int_by_name (player->attrs, "display_surface_type", prev_display_surface_type);
+       mm_attrs_set_int_by_name(player->attrs, "display_surface_type", prev_display_surface_type);
        mm_attrs_set_data_by_name(player->attrs, "display_overlay", prev_display_overlay, sizeof(void*));
-       if ( mmf_attrs_commit ( player->attrs ) )
+       if (mmf_attrs_commit(player->attrs))
        {
                LOGE("failed to commit attributes to rollback");
                MMPLAYER_FLEAVE();
@@ -15180,8 +15180,8 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
        LOGD("surface type(%d), display overlay(%x)", surface_type, display_overlay);
 
        /* get information whether if audiobin is created */
-       if ( !player->pipeline->audiobin ||
-                    !player->pipeline->audiobin[MMPLAYER_A_SINK].gst )
+       if (!player->pipeline->audiobin ||
+                    !player->pipeline->audiobin[MMPLAYER_A_SINK].gst)
        {
                LOGW("audiobin is null, this video content may not have audio data");
                is_audiobin_created = FALSE;
@@ -15193,7 +15193,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 
 
        /* get src pad of decoder and block it */
-       src_pad_dec = gst_element_get_static_pad (GST_ELEMENT(player->pipeline->mainbin[dec_index].gst), "src");
+       src_pad_dec = gst_element_get_static_pad(GST_ELEMENT(player->pipeline->mainbin[dec_index].gst), "src");
        if (!src_pad_dec)
        {
                LOGE("failed to get src pad from decode in mainbin");
@@ -15203,7 +15203,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
        if (!player->doing_seek && previous_state == MM_PLAYER_STATE_PLAYING)
        {
                LOGW("trying to block pad(video)");
-//             if (!gst_pad_set_blocked (src_pad_dec, TRUE))
+//             if (!gst_pad_set_blocked(src_pad_dec, TRUE))
                gst_pad_add_probe(src_pad_dec, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
                        NULL, NULL, NULL);
 
@@ -15241,48 +15241,48 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 
        /* unlink between decoder and videobin and remove previous videosink from videobin */
        GST_ELEMENT_UNLINK(GST_ELEMENT(player->pipeline->mainbin[dec_index].gst),GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_BIN].gst));
-       if ( !gst_bin_remove (GST_BIN(player->pipeline->videobin[MMPLAYER_V_BIN].gst), GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst)) )
+       if (!gst_bin_remove(GST_BIN(player->pipeline->videobin[MMPLAYER_V_BIN].gst), GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst)))
        {
                LOGE("failed to remove former videosink from videobin");
                return MM_ERROR_PLAYER_INTERNAL;
        }
 
-       __mmplayer_del_sink( player, player->pipeline->videobin[MMPLAYER_V_SINK].gst );
+       __mmplayer_del_sink(player, player->pipeline->videobin[MMPLAYER_V_SINK].gst);
 
        /* create a new videosink and add it to videobin */
        player->pipeline->videobin[MMPLAYER_V_SINK].gst = gst_element_factory_make(videosink_element, videosink_element);
        if (!player->pipeline->videobin[MMPLAYER_V_SINK].gst)
        {
-               LOGE ( "failed to create videosink element\n" );
+               LOGE("failed to create videosink element\n");
                MMPLAYER_FLEAVE();
                return MM_ERROR_PLAYER_INTERNAL;
        }
-       gst_bin_add (GST_BIN(player->pipeline->videobin[MMPLAYER_V_BIN].gst), GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst));
-       __mmplayer_add_sink( player, player->pipeline->videobin[MMPLAYER_V_SINK].gst );
-       g_object_set (G_OBJECT (player->pipeline->videobin[MMPLAYER_V_SINK].gst), "qos", TRUE, NULL);
+       gst_bin_add(GST_BIN(player->pipeline->videobin[MMPLAYER_V_BIN].gst), GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst));
+       __mmplayer_add_sink(player, player->pipeline->videobin[MMPLAYER_V_SINK].gst);
+       g_object_set(G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), "qos", TRUE, NULL);
 
        /* save attributes */
        if (player->attrs)
        {
                /* set a new display surface type */
-               mm_attrs_set_int_by_name (player->attrs, "display_surface_type", surface_type);
+               mm_attrs_set_int_by_name(player->attrs, "display_surface_type", surface_type);
                /* set a new diplay overlay */
                switch (surface_type)
                {
                        case MM_DISPLAY_SURFACE_OVERLAY:
                                LOGD("save attributes related to video display surface : id = %d", *(int*)display_overlay);
-                               mm_attrs_set_data_by_name (player->attrs, "display_overlay", display_overlay, sizeof(display_overlay));
+                               mm_attrs_set_data_by_name(player->attrs, "display_overlay", display_overlay, sizeof(display_overlay));
                                break;
                        case MM_DISPLAY_SURFACE_EVAS:
                                LOGD("save attributes related to display surface to EVAS : evas image object = %x", display_overlay);
-                               mm_attrs_set_data_by_name (player->attrs, "display_overlay", display_overlay, sizeof(void*));
+                               mm_attrs_set_data_by_name(player->attrs, "display_overlay", display_overlay, sizeof(void*));
                                break;
                        default:
                                LOGE("invalid type(%d) for changing display surface",surface_type);
                                MMPLAYER_FLEAVE();
                                return MM_ERROR_INVALID_ARGUMENT;
                }
-               if ( mmf_attrs_commit ( player->attrs ) )
+               if (mmf_attrs_commit(player->attrs))
                {
                        LOGE("failed to commit");
                        MMPLAYER_FLEAVE();
@@ -15297,7 +15297,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
        }
 
        /* update video param */
-       if ( MM_ERROR_NONE != _mmplayer_update_video_param( player, "update_all_param") )
+       if (MM_ERROR_NONE != _mmplayer_update_video_param(player, "update_all_param"))
        {
                LOGE("failed to update video param");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -15314,7 +15314,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 
        /* change ghostpad */
        sink_pad_videosink = gst_element_get_static_pad(GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), "sink");
-       if ( !sink_pad_videosink )
+       if (!sink_pad_videosink)
        {
                LOGE("failed to get sink pad from videosink element");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -15325,7 +15325,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
                LOGE("failed to set active to ghost_pad");
                return MM_ERROR_PLAYER_INTERNAL;
        }
-       if ( FALSE == gst_element_add_pad(player->pipeline->videobin[MMPLAYER_V_BIN].gst, player->ghost_pad_for_videobin) )
+       if (FALSE == gst_element_add_pad(player->pipeline->videobin[MMPLAYER_V_BIN].gst, player->ghost_pad_for_videobin))
        {
                LOGE("failed to change ghostpad for videobin");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -15333,13 +15333,13 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
        gst_object_unref(sink_pad_videosink);
 
        /* link decoder with videobin */
-       sink_pad_videobin = gst_element_get_static_pad( GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_BIN].gst), "sink");
-       if ( !sink_pad_videobin )
+       sink_pad_videobin = gst_element_get_static_pad(GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_BIN].gst), "sink");
+       if (!sink_pad_videobin)
        {
                LOGE("failed to get sink pad from videobin");
                return MM_ERROR_PLAYER_INTERNAL;
        }
-       if ( GST_PAD_LINK_OK != GST_PAD_LINK(src_pad_dec, sink_pad_videobin) )
+       if (GST_PAD_LINK_OK != GST_PAD_LINK(src_pad_dec, sink_pad_videobin))
        {
                LOGE("failed to link");
                return MM_ERROR_PLAYER_INTERNAL;
@@ -15352,26 +15352,26 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
        if (!is_audiobin_created)
        {
                LOGW("audiobin is not created, get clock from pipeline..");
-               clock = GST_ELEMENT_CLOCK (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst);
+               clock = GST_ELEMENT_CLOCK(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst);
        }
        else
        {
-               clock = GST_ELEMENT_CLOCK (player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
+               clock = GST_ELEMENT_CLOCK(player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
        }
        if (clock)
        {
                GstClockTime now;
                GstClockTime base_time;
                LOGD("set the clock to videosink");
-               gst_element_set_clock (GST_ELEMENT_CAST(player->pipeline->videobin[MMPLAYER_V_SINK].gst), clock);
-               clock = GST_ELEMENT_CLOCK (player->pipeline->videobin[MMPLAYER_V_SINK].gst);
+               gst_element_set_clock(GST_ELEMENT_CAST(player->pipeline->videobin[MMPLAYER_V_SINK].gst), clock);
+               clock = GST_ELEMENT_CLOCK(player->pipeline->videobin[MMPLAYER_V_SINK].gst);
                if (clock)
                {
                        LOGD("got clock of videosink");
-                       now = gst_clock_get_time ( clock );
-                       base_time = GST_ELEMENT_CAST (player->pipeline->videobin[MMPLAYER_V_SINK].gst)->base_time;
-                       LOGD ("at time %" GST_TIME_FORMAT ", base %"
-                                       GST_TIME_FORMAT, GST_TIME_ARGS (now), GST_TIME_ARGS (base_time));
+                       now = gst_clock_get_time(clock);
+                       base_time = GST_ELEMENT_CAST(player->pipeline->videobin[MMPLAYER_V_SINK].gst)->base_time;
+                       LOGD("at time %" GST_TIME_FORMAT ", base %"
+                                       GST_TIME_FORMAT, GST_TIME_ARGS(now), GST_TIME_ARGS(base_time));
                }
                else
                {
@@ -15401,7 +15401,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 
                /* release blocked and unref src pad of video decoder */
                #if 0
-               if (!gst_pad_set_blocked (src_pad_dec, FALSE))
+               if (!gst_pad_set_blocked(src_pad_dec, FALSE))
                {
                        LOGE("failed to set pad blocked FALSE(video)");
                        return MM_ERROR_PLAYER_INTERNAL;
@@ -15437,14 +15437,14 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
                gint64 pos_msec = 0;
 
                LOGD("do get/set position for new videosink plugin");
-               if (__gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, &position ))
+               if (__gst_get_position(player, MM_PLAYER_POS_FORMAT_TIME, &position))
                {
                        LOGE("failed to get position");
                        return MM_ERROR_PLAYER_INTERNAL;
                }
 #ifdef SINKCHANGE_WITH_ACCURATE_SEEK
                /* accurate seek */
-               if (__gst_set_position(player, MM_PLAYER_POS_FORMAT_TIME, position, TRUE ))
+               if (__gst_set_position(player, MM_PLAYER_POS_FORMAT_TIME, position, TRUE))
                {
                        LOGE("failed to set position");
                        return MM_ERROR_PLAYER_INTERNAL;
@@ -15452,11 +15452,11 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 #else
                /* key unit seek */
                pos_msec = position * G_GINT64_CONSTANT(1000000);
-               ret = __gst_seek ( player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, 1.0,
-                               GST_FORMAT_TIME, ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT ),
+               ret = __gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, 1.0,
+                               GST_FORMAT_TIME, (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT),
                                                        GST_SEEK_TYPE_SET, pos_msec,
-                                                       GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
-               if ( !ret  )
+                                                       GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
+               if (!ret )
                {
                        LOGE("failed to set position");
                        return MM_ERROR_PLAYER_INTERNAL;
@@ -15466,7 +15466,7 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 
        if (src_pad_dec)
        {
-               gst_object_unref (src_pad_dec);
+               gst_object_unref(src_pad_dec);
        }
        LOGD("success to change sink");
 
@@ -15477,14 +15477,14 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
 
 
 /* Note : if silent is true, then subtitle would not be displayed. :*/
-int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent)
+int _mmplayer_set_subtitle_silent(MMHandleType hplayer, int silent)
 {
        mm_player_t* player = (mm_player_t*) hplayer;
 
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->set_mode.subtitle_off = silent;
 
@@ -15504,7 +15504,7 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
        mainbin = player->pipeline->mainbin;
 
        #if 0
-       if(!gst_pad_set_blocked(inpad,TRUE))
+       if (!gst_pad_set_blocked(inpad,TRUE))
        {
                result = MM_ERROR_PLAYER_INTERNAL;
                goto EXIT;
@@ -15516,9 +15516,9 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
        /*Getting pad connected to demuxer audio pad */
        peer = gst_pad_get_peer(inpad);
        /* Disconnecting Demuxer and its peer plugin [audio] */
-       if(peer)
+       if (peer)
        {
-               if(!gst_pad_unlink(inpad,peer))
+               if (!gst_pad_unlink(inpad,peer))
                {
                        result = MM_ERROR_PLAYER_INTERNAL;
                        goto EXIT;
@@ -15530,7 +15530,7 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                goto EXIT;
        }
        /*Removing elements between Demuxer and audiobin*/
-       while(peer != NULL)
+       while (peer != NULL)
        {
                gchar *Element_name = NULL;
                gchar *factory_name = NULL;
@@ -15538,7 +15538,7 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                GstElementFactory *factory = NULL;
                /*Getting peer element*/
                Element = gst_pad_get_parent_element(peer);
-               if(Element == NULL)
+               if (Element == NULL)
                {
                        gst_object_unref(peer);
                        result = MM_ERROR_PLAYER_INTERNAL;
@@ -15548,7 +15548,7 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                Element_name = gst_element_get_name(Element);
                factory = gst_element_get_factory(Element);
                /*checking the element is audio bin*/
-               if(!strcmp(Element_name,"audiobin"))
+               if (!strcmp(Element_name,"audiobin"))
                {
                        gst_object_unref(peer);
                        result = MM_ERROR_NONE;
@@ -15557,7 +15557,7 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                }
                factory_name = GST_OBJECT_NAME(factory);
                pad = gst_element_get_static_pad(Element,"src");
-               if(pad == NULL)
+               if (pad == NULL)
                {
                        result = MM_ERROR_PLAYER_INTERNAL;
             g_free(Element_name);
@@ -15565,9 +15565,9 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                }
                gst_object_unref(peer);
                peer = gst_pad_get_peer(pad);
-               if(peer)
+               if (peer)
                {
-                       if(!gst_pad_unlink(pad,peer))
+                       if (!gst_pad_unlink(pad,peer))
                        {
                                gst_object_unref(peer);
                                gst_object_unref(pad);
@@ -15578,10 +15578,10 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                }
                elements = player->parsers;
                /* Removing the element form the list*/
-               for ( ; elements; elements = g_list_next(elements))
+               for (; elements; elements = g_list_next(elements))
                {
                        Element_name = elements->data;
-                       if(g_strrstr(Element_name,factory_name))
+                       if (g_strrstr(Element_name,factory_name))
                        {
                                player->parsers = g_list_remove(player->parsers,elements->data);
                        }
@@ -15589,19 +15589,19 @@ int _mmplayer_remove_audio_parser_decoder(mm_player_t* player,GstPad *inpad)
                gst_element_set_state(Element,GST_STATE_NULL);
                gst_bin_remove(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst),Element);
                gst_object_unref(pad);
-               if(Element == mainbin[MMPLAYER_M_Q1].gst)
+               if (Element == mainbin[MMPLAYER_M_Q1].gst)
                {
                        mainbin[MMPLAYER_M_Q1].gst = NULL;
                }
-               else if(Element == mainbin[MMPLAYER_M_Q2].gst)
+               else if (Element == mainbin[MMPLAYER_M_Q2].gst)
                {
                        mainbin[MMPLAYER_M_Q2].gst = NULL;
                }
-               else if(Element == mainbin[MMPLAYER_M_DEC1].gst)
+               else if (Element == mainbin[MMPLAYER_M_DEC1].gst)
                {
                        mainbin[MMPLAYER_M_DEC1].gst = NULL;
                }
-               else if(Element == mainbin[MMPLAYER_M_DEC2].gst)
+               else if (Element == mainbin[MMPLAYER_M_DEC2].gst)
                {
                        mainbin[MMPLAYER_M_DEC2].gst = NULL;
                }
@@ -15630,7 +15630,7 @@ int _mmplayer_sync_subtitle_pipeline(mm_player_t* player)
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline , MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline , MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (!(player->pipeline->mainbin) || !(player->pipeline->textbin))
        {
@@ -15642,17 +15642,17 @@ int _mmplayer_sync_subtitle_pipeline(mm_player_t* player)
        mainbin = player->pipeline->mainbin;
        textbin = player->pipeline->textbin;
 
-       current_state = GST_STATE (mainbin[MMPLAYER_M_PIPE].gst);
+       current_state = GST_STATE(mainbin[MMPLAYER_M_PIPE].gst);
 
        // sync clock with current pipeline
-       curr_clock = GST_ELEMENT_CLOCK (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst);
-       curr_time = gst_clock_get_time (curr_clock);
+       curr_clock = GST_ELEMENT_CLOCK(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst);
+       curr_time = gst_clock_get_time(curr_clock);
 
-       base_time = gst_element_get_base_time (GST_ELEMENT_CAST (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
-       start_time = gst_element_get_start_time (GST_ELEMENT_CAST(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
+       base_time = gst_element_get_base_time(GST_ELEMENT_CAST(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
+       start_time = gst_element_get_start_time(GST_ELEMENT_CAST(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
 
-       LOGD ("base_time=%" GST_TIME_FORMAT " start_time=%" GST_TIME_FORMAT " curr_time=%" GST_TIME_FORMAT,
-               GST_TIME_ARGS (base_time), GST_TIME_ARGS (start_time), GST_TIME_ARGS (curr_time));
+       LOGD("base_time=%" GST_TIME_FORMAT " start_time=%" GST_TIME_FORMAT " curr_time=%" GST_TIME_FORMAT,
+               GST_TIME_ARGS(base_time), GST_TIME_ARGS(start_time), GST_TIME_ARGS(curr_time));
 
        if (current_state > GST_STATE_READY)
        {
@@ -15661,24 +15661,24 @@ int _mmplayer_sync_subtitle_pipeline(mm_player_t* player)
                gst_element_set_state(mainbin[MMPLAYER_M_SUBPARSE].gst, GST_STATE_PAUSED);
                gst_element_set_state(mainbin[MMPLAYER_M_SUBSRC].gst, GST_STATE_PAUSED);
 
-               ret = gst_element_get_state (mainbin[MMPLAYER_M_SUBSRC].gst, &element_state, &element_pending_state, 5 * GST_SECOND);
-               if ( GST_STATE_CHANGE_FAILURE == ret )
+               ret = gst_element_get_state(mainbin[MMPLAYER_M_SUBSRC].gst, &element_state, &element_pending_state, 5 * GST_SECOND);
+               if (GST_STATE_CHANGE_FAILURE == ret)
                {
                        LOGE("fail to state change.\n");
                }
        }
 
-       gst_element_set_base_time (textbin[MMPLAYER_T_BIN].gst, base_time);
+       gst_element_set_base_time(textbin[MMPLAYER_T_BIN].gst, base_time);
        gst_element_set_start_time(textbin[MMPLAYER_T_BIN].gst, start_time);
 
        if (curr_clock)
        {
-               gst_element_set_clock (textbin[MMPLAYER_T_BIN].gst, curr_clock);
-               gst_object_unref (curr_clock);
+               gst_element_set_clock(textbin[MMPLAYER_T_BIN].gst, curr_clock);
+               gst_object_unref(curr_clock);
        }
 
        // seek to current position
-       if (!gst_element_query_position (mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &time))
+       if (!gst_element_query_position(mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &time))
        {
                result = MM_ERROR_PLAYER_INVALID_STATE;
                LOGE("gst_element_query_position failed, invalid state\n");
@@ -15686,7 +15686,7 @@ int _mmplayer_sync_subtitle_pipeline(mm_player_t* player)
        }
 
        LOGD("seek time = %lld\n", time);
-       event = gst_event_new_seek (1.0, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH), GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1);
+       event = gst_event_new_seek(1.0, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH), GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1);
        if (event)
        {
                __gst_send_event_to_sink(player, event);
@@ -15724,8 +15724,8 @@ __mmplayer_change_external_subtitle_language(mm_player_t* player, const char* fi
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL( filepath, MM_ERROR_COMMON_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(filepath, MM_ERROR_COMMON_INVALID_ARGUMENT);
 
        if (!(player->pipeline) || !(player->pipeline->mainbin))
        {
@@ -15737,7 +15737,7 @@ __mmplayer_change_external_subtitle_language(mm_player_t* player, const char* fi
        mainbin = player->pipeline->mainbin;
        textbin = player->pipeline->textbin;
 
-       current_state = GST_STATE (mainbin[MMPLAYER_M_PIPE].gst);
+       current_state = GST_STATE(mainbin[MMPLAYER_M_PIPE].gst);
        if (current_state < GST_STATE_READY)
        {
                result = MM_ERROR_PLAYER_INVALID_STATE;
@@ -15753,7 +15753,7 @@ __mmplayer_change_external_subtitle_language(mm_player_t* player, const char* fi
                goto EXIT;
        }
 
-       mm_attrs_get_string_by_name (attrs, "subtitle_uri", &subtitle_uri);
+       mm_attrs_get_string_by_name(attrs, "subtitle_uri", &subtitle_uri);
        if (!subtitle_uri || strlen(subtitle_uri) < 1)
        {
                LOGE("subtitle uri is not proper filepath\n");
@@ -15764,7 +15764,7 @@ __mmplayer_change_external_subtitle_language(mm_player_t* player, const char* fi
        LOGD("old subtitle file path is [%s]\n", subtitle_uri);
        LOGD("new subtitle file path is [%s]\n", filepath);
 
-       if (!strcmp (filepath, subtitle_uri))
+       if (!strcmp(filepath, subtitle_uri))
        {
                LOGD("No need to swtich subtitle, as input filepath is same as current filepath\n");
                goto EXIT;
@@ -15810,8 +15810,8 @@ __mmplayer_change_external_subtitle_language(mm_player_t* player, const char* fi
        charset = util_get_charset(filepath);
        if (charset)
        {
-               LOGD ("detected charset is %s\n", charset );
-               g_object_set (G_OBJECT (mainbin[MMPLAYER_M_SUBPARSE].gst), "subtitle-encoding", charset, NULL);
+               LOGD("detected charset is %s\n", charset);
+               g_object_set(G_OBJECT(mainbin[MMPLAYER_M_SUBPARSE].gst), "subtitle-encoding", charset, NULL);
        }
 
        result = _mmplayer_sync_subtitle_pipeline(player);
@@ -15830,7 +15830,7 @@ int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filep
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (!player->pipeline)  // IDLE state
        {
@@ -15841,9 +15841,9 @@ int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filep
                        result= MM_ERROR_PLAYER_INTERNAL;
                }
        }
-       else    // curr state <> IDLE (READY, PAUSE, PLAYING..)
+       else    // curr state <> IDLE(READY, PAUSE, PLAYING..)
        {
-               if ( filepath == NULL )
+               if (filepath == NULL)
                        return MM_ERROR_COMMON_INVALID_ARGUMENT;
 
                if (!__mmplayer_check_subtitle(player))
@@ -15855,7 +15855,7 @@ int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filep
                                result = MM_ERROR_PLAYER_INTERNAL;
                        }
 
-                       if ( MM_ERROR_NONE != __mmplayer_gst_create_subtitle_src(player) )
+                       if (MM_ERROR_NONE != __mmplayer_gst_create_subtitle_src(player))
                                LOGE("fail to create subtitle src\n");
 
                        result = _mmplayer_sync_subtitle_pipeline(player);
@@ -15871,7 +15871,7 @@ int _mmplayer_set_external_subtitle_path(MMHandleType hplayer, const char* filep
 }
 
 static int
-__mmplayer_change_selector_pad (mm_player_t* player, MMPlayerTrackType type, int index)
+__mmplayer_change_selector_pad(mm_player_t* player, MMPlayerTrackType type, int index)
 {
        int result = MM_ERROR_NONE;
        gchar* change_pad_name = NULL;
@@ -15883,10 +15883,10 @@ __mmplayer_change_selector_pad (mm_player_t* player, MMPlayerTrackType type, int
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player && player->pipeline && player->pipeline->mainbin,
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline && player->pipeline->mainbin,
                                                                                                        MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       LOGD ("Change Track(%d) to %d\n", type, index);
+       LOGD("Change Track(%d) to %d\n", type, index);
 
        mainbin = player->pipeline->mainbin;
 
@@ -15901,14 +15901,14 @@ __mmplayer_change_selector_pad (mm_player_t* player, MMPlayerTrackType type, int
        else
        {
                /* Changing Video Track is not supported. */
-               LOGE ("Track Type Error\n");
+               LOGE("Track Type Error\n");
                goto EXIT;
        }
 
        if (mainbin[elemId].gst == NULL)
        {
                result = MM_ERROR_PLAYER_NO_OP;
-               LOGD ("Req track doesn't exist\n");
+               LOGD("Req track doesn't exist\n");
                goto EXIT;
        }
 
@@ -15916,48 +15916,48 @@ __mmplayer_change_selector_pad (mm_player_t* player, MMPlayerTrackType type, int
        if (total_track_num <= 0)
        {
                result = MM_ERROR_PLAYER_NO_OP;
-               LOGD ("Language list is not available \n");
+               LOGD("Language list is not available \n");
                goto EXIT;
        }
 
        if ((index < 0) || (index >= total_track_num))
        {
                result = MM_ERROR_INVALID_ARGUMENT;
-               LOGD ("Not a proper index : %d \n", index);
+               LOGD("Not a proper index : %d \n", index);
                goto EXIT;
        }
 
        /*To get the new pad from the selector*/
-       change_pad_name = g_strdup_printf ("sink_%u", index);
+       change_pad_name = g_strdup_printf("sink_%u", index);
        if (change_pad_name == NULL)
        {
                result = MM_ERROR_PLAYER_INTERNAL;
-               LOGD ("Pad does not exists\n");
+               LOGD("Pad does not exists\n");
                goto EXIT;
        }
 
-       LOGD ("new active pad name: %s\n", change_pad_name);
+       LOGD("new active pad name: %s\n", change_pad_name);
 
-       sinkpad = gst_element_get_static_pad (mainbin[elemId].gst, change_pad_name);
+       sinkpad = gst_element_get_static_pad(mainbin[elemId].gst, change_pad_name);
        if (sinkpad == NULL)
        {
-               LOGD ("sinkpad is NULL");
+               LOGD("sinkpad is NULL");
                result = MM_ERROR_PLAYER_INTERNAL;
                goto EXIT;
        }
 
-       LOGD ("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
-       g_object_set (mainbin[elemId].gst, "active-pad", sinkpad, NULL);
+       LOGD("Set Active Pad - %s:%s\n", GST_DEBUG_PAD_NAME(sinkpad));
+       g_object_set(mainbin[elemId].gst, "active-pad", sinkpad, NULL);
 
        caps = gst_pad_get_current_caps(sinkpad);
        MMPLAYER_LOG_GST_CAPS_TYPE(caps);
 
        if (sinkpad)
-               gst_object_unref (sinkpad);
+               gst_object_unref(sinkpad);
 
        if (type == MM_PLAYER_TRACK_TYPE_AUDIO)
        {
-               __mmplayer_set_audio_attrs (player, caps);
+               __mmplayer_set_audio_attrs(player, caps);
        }
 
 EXIT:
@@ -15966,7 +15966,7 @@ EXIT:
        return result;
 }
 
-int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType type, int index)
+int _mmplayer_change_track_language(MMHandleType hplayer, MMPlayerTrackType type, int index)
 {
        int result = MM_ERROR_NONE;
        mm_player_t* player = NULL;
@@ -15981,11 +15981,11 @@ int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType typ
        MMPLAYER_FENTER();
 
        player = (mm_player_t*)hplayer;
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (!player->pipeline)
        {
-               LOGE ("Track %d pre setting -> %d\n", type, index);
+               LOGE("Track %d pre setting -> %d\n", type, index);
 
                player->selector[type].active_pad_index = index;
                goto EXIT;
@@ -16011,14 +16011,14 @@ int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType typ
        if (current_state < GST_STATE_PAUSED)
        {
                result = MM_ERROR_PLAYER_INVALID_STATE;
-               LOGW ("Pipeline not in porper state\n");
+               LOGW("Pipeline not in porper state\n");
                goto EXIT;
        }
 
        result = __mmplayer_change_selector_pad(player, type, index);
        if (result != MM_ERROR_NONE)
        {
-               LOGE ("change selector pad error\n");
+               LOGE("change selector pad error\n");
                goto EXIT;
        }
 
@@ -16026,10 +16026,10 @@ int _mmplayer_change_track_language (MMHandleType hplayer, MMPlayerTrackType typ
 
        if (current_state == GST_STATE_PLAYING)
        {
-               event = gst_event_new_seek (1.0, GST_FORMAT_TIME,(GstSeekFlags) (GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SKIP),GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1);
+               event = gst_event_new_seek(1.0, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SKIP),GST_SEEK_TYPE_SET, time, GST_SEEK_TYPE_NONE, -1);
                if (event)
                {
-                       __gst_send_event_to_sink (player, event);
+                       __gst_send_event_to_sink(player, event);
                }
                else
                {
@@ -16042,14 +16042,14 @@ EXIT:
        return result;
 }
 
-int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent)
+int _mmplayer_get_subtitle_silent(MMHandleType hplayer, int* silent)
 {
        mm_player_t* player = (mm_player_t*) hplayer;
 
        MMPLAYER_FENTER();
 
        /* check player handle */
-       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        *silent = player->set_mode.subtitle_off;
 
@@ -16061,24 +16061,24 @@ int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent)
 }
 
 gboolean
-__is_ms_buff_src( mm_player_t* player )
+__is_ms_buff_src(mm_player_t* player)
 {
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
-       return ( player->profile.uri_type == MM_PLAYER_URI_TYPE_MS_BUFF) ? TRUE : FALSE;
+       return(player->profile.uri_type == MM_PLAYER_URI_TYPE_MS_BUFF) ? TRUE : FALSE;
 }
 
 gboolean
 __has_suffix(mm_player_t* player, const gchar* suffix)
 {
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
-       MMPLAYER_RETURN_VAL_IF_FAIL( suffix, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(suffix, FALSE);
 
        gboolean ret = FALSE;
        gchar* t_url = g_ascii_strdown(player->profile.uri, -1);
        gchar* t_suffix = g_ascii_strdown(suffix, -1);
 
-       if ( g_str_has_suffix(player->profile.uri, suffix) )
+       if (g_str_has_suffix(player->profile.uri, suffix))
        {
                ret = TRUE;
        }
@@ -16094,7 +16094,7 @@ _mmplayer_set_display_zoom(MMHandleType hplayer, float level, int x, int y)
 {
        mm_player_t* player = (mm_player_t*) hplayer;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        MMPLAYER_VIDEO_SINK_CHECK(player);
 
@@ -16113,7 +16113,7 @@ _mmplayer_get_display_zoom(MMHandleType hplayer, float *level, int *x, int *y)
        int _x = 0;
        int _y = 0;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        MMPLAYER_VIDEO_SINK_CHECK(player);
 
@@ -16133,7 +16133,7 @@ _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode)
 {
        mm_player_t* player = (mm_player_t*) hplayer;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        if (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_NULL)
        {
@@ -16153,7 +16153,7 @@ _mmplayer_enable_sync_handler(MMHandleType hplayer, bool enable)
 {
        mm_player_t* player = (mm_player_t*) hplayer;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        LOGD("enable sync handler : %s", (enable)?"ON":"OFF");
        player->sync_handler = enable;
@@ -16184,9 +16184,9 @@ _mmplayer_set_video_share_master_clock( MMHandleType hplayer,
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player->pipeline->mainbin, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline->mainbin, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        // LOGD("in(us) : %lld, %lld, %lld, %lld, %lld", clock, clock_delta, video_time, media_clock, audio_time);
 
@@ -16198,26 +16198,26 @@ _mmplayer_set_video_share_master_clock(       MMHandleType hplayer,
 
        mainbin = player->pipeline->mainbin;
 
-       curr_clock = gst_pipeline_get_clock (GST_PIPELINE_CAST(mainbin[MMPLAYER_M_PIPE].gst));
-       curr_time = gst_clock_get_time (curr_clock);
+       curr_clock = gst_pipeline_get_clock(GST_PIPELINE_CAST(mainbin[MMPLAYER_M_PIPE].gst));
+       curr_time = gst_clock_get_time(curr_clock);
 
        current_state = MMPLAYER_CURRENT_STATE(player);
 
-       if ( current_state == MM_PLAYER_STATE_PLAYING )
+       if (current_state == MM_PLAYER_STATE_PLAYING)
                query_ret = gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &position);
 
-       if ( ( current_state != MM_PLAYER_STATE_PLAYING ) ||
-                ( !query_ret ))
+       if ((current_state != MM_PLAYER_STATE_PLAYING) ||
+               (!query_ret))
        {
                position = player->last_position;
-               LOGD ("query fail. %lld", position);
+               LOGD("query fail. %lld", position);
        }
 
        clock*= GST_USECOND;
        clock_delta *= GST_USECOND;
 
        api_delta = clock - curr_time;
-       if ((player->video_share_api_delta == 0 ) || (player->video_share_api_delta > api_delta))
+       if ((player->video_share_api_delta == 0) || (player->video_share_api_delta > api_delta))
        {
                player->video_share_api_delta = api_delta;
        }
@@ -16226,7 +16226,7 @@ _mmplayer_set_video_share_master_clock( MMHandleType hplayer,
                clock_delta += (api_delta - player->video_share_api_delta);
        }
 
-       if ((player->video_share_clock_delta == 0 ) || (player->video_share_clock_delta > clock_delta))
+       if ((player->video_share_clock_delta == 0) || (player->video_share_clock_delta > clock_delta))
        {
                player->video_share_clock_delta = (gint64)clock_delta;
 
@@ -16234,7 +16234,7 @@ _mmplayer_set_video_share_master_clock( MMHandleType hplayer,
                position_delta *= GST_USECOND;
 
                adj_base_time = position_delta;
-               LOGD ("video_share_clock_delta = %lld, adj = %lld", player->video_share_clock_delta, adj_base_time);
+               LOGD("video_share_clock_delta = %lld, adj = %lld", player->video_share_clock_delta, adj_base_time);
 
        }
        else
@@ -16249,7 +16249,7 @@ _mmplayer_set_video_share_master_clock( MMHandleType hplayer,
 
                adj_base_time = position - new_play_time;
 
-               LOGD ("%lld(delay) = %lld - %lld / %lld(adj) = %lld(slave_pos) - %lld(master_pos) - %lld(delay)",
+               LOGD("%lld(delay) = %lld - %lld / %lld(adj) = %lld(slave_pos) - %lld(master_pos) - %lld(delay)",
                        network_delay, clock_delta, player->video_share_clock_delta, adj_base_time, position, video_time, network_delay);
        }
 
@@ -16261,30 +16261,30 @@ _mmplayer_set_video_share_master_clock(       MMHandleType hplayer,
        if ((player->pipeline->audiobin) &&
                (player->pipeline->audiobin[MMPLAYER_A_SINK].gst))
        {
-               start_time_audio = gst_element_get_start_time (player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
+               start_time_audio = gst_element_get_start_time(player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
 
                if (start_time_audio != GST_CLOCK_TIME_NONE)
                {
-                       LOGD ("audio sink : gst_element_set_start_time -> NONE");
+                       LOGD("audio sink : gst_element_set_start_time -> NONE");
                        gst_element_set_start_time(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, GST_CLOCK_TIME_NONE);
                }
 
-               base_time = gst_element_get_base_time (player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
+               base_time = gst_element_get_base_time(player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
        }
 
        if ((player->pipeline->videobin) &&
                (player->pipeline->videobin[MMPLAYER_V_SINK].gst))
        {
-               start_time_video = gst_element_get_start_time (player->pipeline->videobin[MMPLAYER_V_SINK].gst);
+               start_time_video = gst_element_get_start_time(player->pipeline->videobin[MMPLAYER_V_SINK].gst);
 
                if (start_time_video != GST_CLOCK_TIME_NONE)
                {
-                       LOGD ("video sink : gst_element_set_start_time -> NONE");
+                       LOGD("video sink : gst_element_set_start_time -> NONE");
                        gst_element_set_start_time(player->pipeline->videobin[MMPLAYER_V_SINK].gst, GST_CLOCK_TIME_NONE);
                }
 
                // if videobin exist, get base_time from videobin.
-               base_time = gst_element_get_base_time (player->pipeline->videobin[MMPLAYER_V_SINK].gst);
+               base_time = gst_element_get_base_time(player->pipeline->videobin[MMPLAYER_V_SINK].gst);
        }
 
        new_base_time = base_time + adj_base_time;
@@ -16318,35 +16318,35 @@ _mmplayer_get_video_share_master_clock(       MMHandleType hplayer,
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player->pipeline->mainbin, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline->mainbin, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( video_time, MM_ERROR_COMMON_INVALID_ARGUMENT );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( media_clock, MM_ERROR_COMMON_INVALID_ARGUMENT );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( audio_time, MM_ERROR_COMMON_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(video_time, MM_ERROR_COMMON_INVALID_ARGUMENT);
+       MMPLAYER_RETURN_VAL_IF_FAIL(media_clock, MM_ERROR_COMMON_INVALID_ARGUMENT);
+       MMPLAYER_RETURN_VAL_IF_FAIL(audio_time, MM_ERROR_COMMON_INVALID_ARGUMENT);
 
        mainbin = player->pipeline->mainbin;
 
-       curr_clock = gst_pipeline_get_clock (GST_PIPELINE_CAST(mainbin[MMPLAYER_M_PIPE].gst));
+       curr_clock = gst_pipeline_get_clock(GST_PIPELINE_CAST(mainbin[MMPLAYER_M_PIPE].gst));
 
        current_state = MMPLAYER_CURRENT_STATE(player);
 
-       if ( current_state != MM_PLAYER_STATE_PAUSED )
+       if (current_state != MM_PLAYER_STATE_PAUSED)
                query_ret = gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &position);
 
-       if ( ( current_state == MM_PLAYER_STATE_PAUSED ) ||
-                ( !query_ret ))
+       if ((current_state == MM_PLAYER_STATE_PAUSED) ||
+               (!query_ret))
        {
                position = player->last_position;
        }
 
        *media_clock = *video_time = *audio_time = (position/GST_USECOND);
 
-       LOGD("media_clock: %lld, video_time: %lld (us)", *media_clock, *video_time);
+       LOGD("media_clock: %lld, video_time: %lld(us)", *media_clock, *video_time);
 
        if (curr_clock)
-               gst_object_unref (curr_clock);
+               gst_object_unref(curr_clock);
 
        MMPLAYER_FLEAVE();
 
@@ -16361,17 +16361,17 @@ _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( angle, MM_ERROR_COMMON_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(angle, MM_ERROR_COMMON_INVALID_ARGUMENT);
 
        if (player->v_stream_caps)
        {
                GstStructure *str = NULL;
 
-               str = gst_caps_get_structure (player->v_stream_caps, 0);
-               if ( !gst_structure_get_int (str, "orientation", &org_angle))
+               str = gst_caps_get_structure(player->v_stream_caps, 0);
+               if (!gst_structure_get_int(str, "orientation", &org_angle))
                {
-                       LOGD ("missing 'orientation' field in video caps");
+                       LOGD("missing 'orientation' field in video caps");
                }
        }
 
@@ -16385,48 +16385,48 @@ _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle)
 static gboolean
 __mmplayer_add_dump_buffer_probe(mm_player_t *player, GstElement *element)
 {
-       MMPLAYER_RETURN_VAL_IF_FAIL (player, FALSE);
-       MMPLAYER_RETURN_VAL_IF_FAIL (element, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
+       MMPLAYER_RETURN_VAL_IF_FAIL(element, FALSE);
 
-       gchar *factory_name = GST_OBJECT_NAME (gst_element_get_factory(element));
+       gchar *factory_name = GST_OBJECT_NAME(gst_element_get_factory(element));
        gchar dump_file_name[PLAYER_INI_MAX_STRLEN*2];
 
        int idx = 0;
 
-       for ( idx = 0; player->ini.dump_element_keyword[idx][0] != '\0'; idx++ )
+       for (idx = 0; player->ini.dump_element_keyword[idx][0] != '\0'; idx++)
        {
                if (g_strrstr(factory_name, player->ini.dump_element_keyword[idx]))
                {
                        LOGD("dump [%s] sink pad", player->ini.dump_element_keyword[idx]);
                        mm_player_dump_t *dump_s;
-                       dump_s = g_malloc (sizeof(mm_player_dump_t));
+                       dump_s = g_malloc(sizeof(mm_player_dump_t));
 
                        if (dump_s == NULL)
                        {
-                               LOGE ("malloc fail");
+                               LOGE("malloc fail");
                                return FALSE;
                        }
 
                        dump_s->dump_element_file = NULL;
                        dump_s->dump_pad = NULL;
-                       dump_s->dump_pad = gst_element_get_static_pad (element, "sink");
+                       dump_s->dump_pad = gst_element_get_static_pad(element, "sink");
 
                        if (dump_s->dump_pad)
                        {
-                               memset (dump_file_name, 0x00, PLAYER_INI_MAX_STRLEN*2);
-                               snprintf (dump_file_name, PLAYER_INI_MAX_STRLEN*2, "%s/%s_sink_pad.dump", player->ini.dump_element_path, player->ini.dump_element_keyword[idx]);
+                               memset(dump_file_name, 0x00, PLAYER_INI_MAX_STRLEN*2);
+                               snprintf(dump_file_name, PLAYER_INI_MAX_STRLEN*2, "%s/%s_sink_pad.dump", player->ini.dump_element_path, player->ini.dump_element_keyword[idx]);
                                dump_s->dump_element_file = fopen(dump_file_name,"w+");
-                               dump_s->probe_handle_id = gst_pad_add_probe (dump_s->dump_pad, GST_PAD_PROBE_TYPE_BUFFER, __mmplayer_dump_buffer_probe_cb, dump_s->dump_element_file, NULL);
+                               dump_s->probe_handle_id = gst_pad_add_probe(dump_s->dump_pad, GST_PAD_PROBE_TYPE_BUFFER, __mmplayer_dump_buffer_probe_cb, dump_s->dump_element_file, NULL);
                                /* add list for removed buffer probe and close FILE */
-                               player->dump_list = g_list_append (player->dump_list, dump_s);
-                               LOGD ("%s sink pad added buffer probe for dump", factory_name);
+                               player->dump_list = g_list_append(player->dump_list, dump_s);
+                               LOGD("%s sink pad added buffer probe for dump", factory_name);
                                return TRUE;
                        }
                        else
                        {
                                g_free(dump_s);
                                dump_s = NULL;
-                               LOGE ("failed to get %s sink pad added", factory_name);
+                               LOGE("failed to get %s sink pad added", factory_name);
                        }
 
 
@@ -16443,31 +16443,31 @@ __mmplayer_dump_buffer_probe_cb(GstPad *pad,  GstPadProbeInfo *info, gpointer u_
        GstBuffer *buffer = gst_pad_probe_info_get_buffer(info);
        GstMapInfo probe_info = GST_MAP_INFO_INIT;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( dump_data, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(dump_data, FALSE);
 
        gst_buffer_map(buffer, &probe_info, GST_MAP_READ);
 
-//     LOGD ("buffer timestamp = %" GST_TIME_FORMAT, GST_TIME_ARGS( GST_BUFFER_TIMESTAMP(buffer)));
+//     LOGD("buffer timestamp = %" GST_TIME_FORMAT, GST_TIME_ARGS(GST_BUFFER_TIMESTAMP(buffer)));
 
-       fwrite ( probe_info.data, 1, probe_info.size , dump_data);
+       fwrite(probe_info.data, 1, probe_info.size , dump_data);
 
        return GST_PAD_PROBE_OK;
 }
 
 static void
-__mmplayer_release_dump_list (GList *dump_list)
+__mmplayer_release_dump_list(GList *dump_list)
 {
        if (dump_list)
        {
                GList *d_list = dump_list;
-               for ( ;d_list ; d_list = g_list_next(d_list))
+               for (;d_list ; d_list = g_list_next(d_list))
                {
                        mm_player_dump_t *dump_s = d_list->data;
                        if (dump_s->dump_pad)
                        {
                                if (dump_s->probe_handle_id)
                                {
-                                       gst_pad_remove_probe (dump_s->dump_pad, dump_s->probe_handle_id);
+                                       gst_pad_remove_probe(dump_s->dump_pad, dump_s->probe_handle_id);
                                }
 
                        }
@@ -16490,8 +16490,8 @@ _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
-       MMPLAYER_RETURN_VAL_IF_FAIL ( exist, MM_ERROR_INVALID_ARGUMENT );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+       MMPLAYER_RETURN_VAL_IF_FAIL(exist, MM_ERROR_INVALID_ARGUMENT);
 
        *exist = player->has_closed_caption;
 
@@ -16529,11 +16529,11 @@ __gst_appsrc_feed_audio_data(GstElement *element, guint size, gpointer user_data
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_AUDIO;
        guint64 current_level_bytes=0;
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        g_object_get(G_OBJECT(element), "current-level-bytes", &current_level_bytes, NULL);
 
-       LOGI("app-src: feed audio (%llu)\n", current_level_bytes);
+       LOGI("app-src: feed audio(%llu)\n", current_level_bytes);
 
        if (player->media_stream_buffer_status_cb[type])
        {
@@ -16548,11 +16548,11 @@ __gst_appsrc_feed_video_data(GstElement *element, guint size, gpointer user_data
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_VIDEO;
        guint64 current_level_bytes=0;
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        g_object_get(G_OBJECT(element), "current-level-bytes", &current_level_bytes, NULL);
 
-       LOGI("app-src: feed video (%llu)\n", current_level_bytes);
+       LOGI("app-src: feed video(%llu)\n", current_level_bytes);
 
        if (player->media_stream_buffer_status_cb[type])
        {
@@ -16567,7 +16567,7 @@ __gst_appsrc_feed_subtitle_data(GstElement *element, guint size, gpointer user_d
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_TEXT;
        guint64 current_level_bytes=0;
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        LOGI("app-src: feed subtitle\n");
 
@@ -16586,7 +16586,7 @@ __gst_appsrc_enough_audio_data(GstElement *element, gpointer user_data)
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_AUDIO;
        guint64 current_level_bytes=0;
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        LOGI("app-src: audio buffer is full.\n");
 
@@ -16605,7 +16605,7 @@ __gst_appsrc_enough_video_data(GstElement *element, gpointer user_data)
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_VIDEO;
        guint64 current_level_bytes=0;
 
-       MMPLAYER_RETURN_IF_FAIL ( player );
+       MMPLAYER_RETURN_IF_FAIL(player);
 
        LOGI("app-src: video buffer is full.\n");
 
@@ -16618,12 +16618,12 @@ __gst_appsrc_enough_video_data(GstElement *element, gpointer user_data)
 }
 
 gboolean
-__gst_seek_audio_data (GstElement * appsrc, guint64 position, gpointer user_data)
+__gst_seek_audio_data(GstElement * appsrc, guint64 position, gpointer user_data)
 {
        mm_player_t *player  = (mm_player_t*)user_data;
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_AUDIO;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        LOGD("app-src: seek audio data %llu\n", position);
 
@@ -16636,12 +16636,12 @@ __gst_seek_audio_data (GstElement * appsrc, guint64 position, gpointer user_data
 }
 
 gboolean
-__gst_seek_video_data (GstElement * appsrc, guint64 position, gpointer user_data)
+__gst_seek_video_data(GstElement * appsrc, guint64 position, gpointer user_data)
 {
        mm_player_t *player  = (mm_player_t*)user_data;
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_VIDEO;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        LOGD("app-src: seek video data %llu\n", position);
 
@@ -16654,12 +16654,12 @@ __gst_seek_video_data (GstElement * appsrc, guint64 position, gpointer user_data
 }
 
 gboolean
-__gst_seek_subtitle_data (GstElement * appsrc, guint64 position, gpointer user_data)
+__gst_seek_subtitle_data(GstElement * appsrc, guint64 position, gpointer user_data)
 {
        mm_player_t *player  = (mm_player_t*)user_data;
        MMPlayerStreamType type = MM_PLAYER_STREAM_TYPE_TEXT;
 
-       MMPLAYER_RETURN_VAL_IF_FAIL( player, FALSE );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
 
        LOGD("app-src: seek subtitle data\n");
 
@@ -16678,7 +16678,7 @@ _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel)
 
        MMPLAYER_FENTER();
 
-       MMPLAYER_RETURN_VAL_IF_FAIL ( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
        player->pcm_samplerate = samplerate;
        player->pcm_channel = channel;