[0.6.234] Disable ringbuffer in queue2 when streaming mp3
[platform/core/multimedia/libmm-player.git] / src / mm_player_gst.c
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;
                                }