[0.6.234] Disable ringbuffer in queue2 when streaming mp3 90/242690/2
authorGilbok Lee <gilbok.lee@samsung.com>
Fri, 28 Aug 2020 07:09:52 +0000 (16:09 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 1 Sep 2020 06:42:48 +0000 (15:42 +0900)
- Setting ringbuffer make queue2 work in pull mode which causes the memory usage increases in muse-server

Change-Id: I29e120d6d51ab6ce2c83e5f8b8523b989ea889fa

packaging/libmm-player.spec
src/mm_player_gst.c

index 47ffbc3..84cbf1f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.233
+Version:    0.6.234
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index cefa10e..ccc7bbd 100644 (file)
@@ -82,6 +82,28 @@ print_tag(const GstTagList *list, const gchar *tag, gpointer unused)
 #endif
 
 static gboolean
+__mmplayer_is_hls_type(gchar *type) {
+       if (g_strrstr(type, "application/x-hls"))
+               return TRUE;
+       return FALSE;
+}
+
+static gboolean
+__mmplayer_is_mpegts_type(gchar *type) {
+       if (g_strrstr(type, "video/mpegts"))
+               return TRUE;
+       return FALSE;
+}
+
+static gboolean
+__mmplayer_is_mp3_type(gchar *type) {
+       if (g_strrstr(type, "application/x-id3") ||
+               (g_strrstr(type, "audio/mpeg") && g_strrstr(type, "mpegversion=(int)1")))
+               return TRUE;
+       return FALSE;
+}
+
+static gboolean
 __mmplayer_check_error_posted_from_activated_track(mmplayer_t *player, gchar *src_element_name)
 {
        /* check whether the error is posted from not-activated track or not */
@@ -3073,7 +3095,8 @@ __mmplayer_gst_deep_element_added(GstElement *bin, GstBin *child, GstElement *el
                        /* NOTE : in case of ts streaming, player could not get the correct duration info *
                         *                skip the pull mode(file or ring buffering) setting. */
                        if (dur_bytes > 0) {
-                               if ((!g_strrstr(player->type, "video/mpegts")) && (!g_strrstr(player->type, "application/x-hls"))) {
+                               if (!(__mmplayer_is_mpegts_type(player->type) || __mmplayer_is_hls_type(player->type)
+                                       || __mmplayer_is_mp3_type(player->type))) {
                                        type = MUXED_BUFFER_TYPE_MEM_RING_BUFFER;
                                        player->streamer->ring_buffer_size = player->ini.http_ring_buffer_size;
                                }