From 2a58f78ad67b67d79efa90d410f3e78f7fe4eb21 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Mon, 15 Jan 2018 14:41:02 +0900 Subject: [PATCH] [0.6.88] fix bug about _get_stream_service_type Change-Id: Ifa808adbe10e2a92658fe3f2a47f9f5265de7d68 --- packaging/libmm-player.spec | 2 +- src/mm_player_priv.c | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 0e361e4..d1e5680 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.87 +Version: 0.6.88 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index 7d3b6b0..a5f55f6 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -153,7 +153,7 @@ static void __mmplayer_set_audio_attrs(mm_player_t* player, GstCaps* caps); static void __mmplayer_gst_rtp_no_more_pads(GstElement *element, 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 MMStreamingType __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_release_misc(mm_player_t* player); static void __mmplayer_release_misc_post(mm_player_t* player); @@ -300,7 +300,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag) GstStructure* p = NULL; MMHandleType attrs = 0; gchar *path = NULL; - gint stream_service_type = STREAMING_SERVICE_NONE; + MMStreamingType stream_service_type = STREAMING_SERVICE_NONE; struct stat sb; MMPLAYER_FENTER(); @@ -359,7 +359,8 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag) /* 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); + if (stream_service_type < STREAMING_SERVICE_NONE) + 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)) { @@ -524,9 +525,9 @@ _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 MMStreamingType __mmplayer_get_stream_service_type(mm_player_t* player) { - gint streaming_type = STREAMING_SERVICE_NONE; + MMStreamingType streaming_type = STREAMING_SERVICE_NONE; MMPLAYER_FENTER(); @@ -534,7 +535,7 @@ static gboolean __mmplayer_get_stream_service_type(mm_player_t* player) player->pipeline && player->pipeline->mainbin && player->pipeline->mainbin[MMPLAYER_M_SRC].gst, - FALSE); + STREAMING_SERVICE_NONE); /* streaming service type if streaming */ if (!MMPLAYER_IS_STREAMING(player)) @@ -7629,7 +7630,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo if (!gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec)) { /* For RTSP Streaming , duration is not returned in READY state. So seek to the previous position does not work properly. * Added a patch to postpone the actual seek when state changes to PLAY. Sending a fake SEEK_COMPLETED event to finish the current request. */ - if ((MMPLAYER_IS_RTSP_STREAMING(player)) && (__mmplayer_get_stream_service_type(player) != STREAMING_SERVICE_LIVE)) { + if ((MMPLAYER_IS_RTSP_STREAMING(player)) && (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { player->pending_seek.is_pending = TRUE; player->pending_seek.format = format; player->pending_seek.pos = position; @@ -7692,7 +7693,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo This causes problem is position calculation during normal pause resume scenarios also. Currently during seek , we are sending the current position to rtspsrc module for position saving for later use. */ if ((MMPLAYER_IS_RTSP_STREAMING(player)) && - (__mmplayer_get_stream_service_type(player) != STREAMING_SERVICE_LIVE)) { + (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { if (!gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_nsec)) LOGW("getting current position failed in seek\n"); @@ -9864,7 +9865,7 @@ _mmplayer_pause(MMHandleType hplayer) This causes problem is position calculation during normal pause resume scenarios also. Currently during pause , we are sending the current position to rtspsrc module for position saving. */ if ((MMPLAYER_IS_RTSP_STREAMING(player)) && - (__mmplayer_get_stream_service_type(player) != STREAMING_SERVICE_LIVE)) { + (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) { g_object_set(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "resume-position", player->last_position, NULL); } } @@ -11574,6 +11575,7 @@ __mmplayer_check_codec_info(mm_player_t* player, const char* klass, GstCaps* cap &player->video_decoder_resource) != MM_RESOURCE_MANAGER_ERROR_NONE) { LOGE("could not mark video_decoder resource for acquire"); + ret = MM_ERROR_PLAYER_INTERNAL; goto DONE; } } else { -- 2.34.1