From d6ac0c6d1cc15ddc6fceb1a9038c2bd5463eb105 Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Thu, 4 Apr 2019 20:11:56 +0900 Subject: [PATCH] [0.6.179] check uri suffix considering extra option - check the uri suffix considering extra option as below. http://xxxx.m3u8?xxxx - remove dead code - use secure dlog for uri info Change-Id: I862f8fd6cb0ee60e0dc81ba2cfb484bc27d77fb6 --- packaging/libmm-player.spec | 2 +- src/include/mm_player_priv.h | 2 -- src/include/mm_player_utils.h | 4 ++-- src/mm_player_priv.c | 39 ++++------------------------------- src/mm_player_utils.c | 7 +++++-- 5 files changed, 12 insertions(+), 42 deletions(-) diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 3c63d57..43209c1 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.178 +Version: 0.6.179 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/include/mm_player_priv.h b/src/include/mm_player_priv.h index 726f776..21c5010 100644 --- a/src/include/mm_player_priv.h +++ b/src/include/mm_player_priv.h @@ -420,7 +420,6 @@ typedef struct { typedef struct { bool rich_audio; - bool safety_volume; bool video_zc; // video zero-copy bool subtitle_off; bool media_packet_video_stream; @@ -639,7 +638,6 @@ typedef struct { /* autoplugging */ GList *factories; - GList *parsers; // list of linked parser name GList *audio_decoders; // list of linked audio name gboolean no_more_pad; gint num_dynamic_pad; diff --git a/src/include/mm_player_utils.h b/src/include/mm_player_utils.h index 61e82a3..754e8cf 100644 --- a/src/include/mm_player_utils.h +++ b/src/include/mm_player_utils.h @@ -266,8 +266,8 @@ #define MMPLAYER_IS_SMOOTH_STREAMING(x_player) __is_smooth_streaming(x_player) #define MMPLAYER_IS_MS_BUFF_SRC(x_player) __is_ms_buff_src(x_player) -#define MMPLAYER_URL_HAS_DASH_SUFFIX(x_player) __has_suffix(x_player, "mpd") -#define MMPLAYER_URL_HAS_HLS_SUFFIX(x_player) __has_suffix(x_player, "m3u8") +#define MMPLAYER_URL_HAS_DASH_SUFFIX(x_player) __has_suffix(x_player, ".mpd") +#define MMPLAYER_URL_HAS_HLS_SUFFIX(x_player) __has_suffix(x_player, ".m3u8") #define MMPLAYER_STREAM_TYPE_GET_NAME(type) __get_stream_type_name(type) diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index de32570..91b8523 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -6355,17 +6355,6 @@ __mmplayer_initialize_gapless_play(mm_player_t *player) mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0); - /* clean found parsers */ - if (player->parsers) { - GList *parsers = player->parsers; - for (; parsers; parsers = g_list_next(parsers)) { - gchar *name = parsers->data; - MMPLAYER_FREEIF(name); - } - g_list_free(player->parsers); - player->parsers = NULL; - } - /* clean found audio decoders */ if (player->audio_decoders) { GList *a_dec = player->audio_decoders; @@ -6689,12 +6678,12 @@ _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path if (is_first_path) { if (num_of_list == 0) { player->uri_info.uri_list = g_list_append(player->uri_info.uri_list, g_strdup(uri)); - LOGD("add original path : %s", uri); + SECURE_LOGD("add original path : %s", uri); } else { player->uri_info.uri_list = g_list_delete_link(player->uri_info.uri_list, g_list_nth(player->uri_info.uri_list, 0)); player->uri_info.uri_list = g_list_insert(player->uri_info.uri_list, g_strdup(uri), 0); - LOGD("change original path : %s", uri); + SECURE_LOGD("change original path : %s", uri); } } else { MMHandleType attrs = 0; @@ -6714,12 +6703,12 @@ _mmplayer_set_next_uri(MMHandleType hplayer, const char *uri, bool is_first_path 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", original_uri); + SECURE_LOGD("add original path at first : %s", 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)); + SECURE_LOGD("add new path : %s(total num of list = %d)", uri, g_list_length(player->uri_info.uri_list)); } MMPLAYER_FLEAVE(); @@ -7382,20 +7371,11 @@ __mmplayer_gst_element_added(GstElement *bin, GstElement *element, gpointer data if (__mmplayer_add_dump_buffer_probe(player, element)) LOGD("add buffer probe"); - //<- 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); } - //-> temp code - - if (g_strrstr(klass, "Parser")) { - gchar *selected = NULL; - - selected = g_strdup(factory_name); - player->parsers = g_list_append(player->parsers, selected); - } if (g_strrstr(klass, "Demuxer/Adaptive")) { player->pipeline->mainbin[MMPLAYER_M_ADAPTIVE_DEMUX].id = MMPLAYER_M_ADAPTIVE_DEMUX; @@ -7576,17 +7556,6 @@ __mmplayer_release_misc_post(mm_player_t *player) mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0); - /* clean found parsers */ - if (player->parsers) { - GList *parsers = player->parsers; - for (; parsers; parsers = g_list_next(parsers)) { - gchar *name = parsers->data; - MMPLAYER_FREEIF(name); - } - g_list_free(player->parsers); - player->parsers = NULL; - } - /* clean found audio decoders */ if (player->audio_decoders) { GList *a_dec = player->audio_decoders; diff --git a/src/mm_player_utils.c b/src/mm_player_utils.c index 1f03baf..496156a 100644 --- a/src/mm_player_utils.c +++ b/src/mm_player_utils.c @@ -146,9 +146,12 @@ __has_suffix(mm_player_t *player, const gchar *suffix) gboolean ret = FALSE; gchar *t_url = g_ascii_strdown(player->profile.uri, -1); gchar *t_suffix = g_ascii_strdown(suffix, -1); + gchar *opt = strchr(t_url, '?'); - if (g_str_has_suffix(player->profile.uri, suffix)) - ret = TRUE; + if (opt) + *opt = '\0'; + + ret = g_str_has_suffix(t_url, t_suffix); MMPLAYER_FREEIF(t_url); MMPLAYER_FREEIF(t_suffix); -- 2.34.1