diff options
author | Gilbok Lee <gilbok.lee@samsung.com> | 2017-10-13 16:39:17 +0900 |
---|---|---|
committer | Gilbok Lee <gilbok.lee@samsung.com> | 2017-10-13 16:39:17 +0900 |
commit | 44dd8e4580d51997bd0c1a939379e68172f3c345 (patch) | |
tree | 369ba1c0d584306e7878e07848fdb5dc8f8b2776 | |
parent | 7497dc8ece5e6f75e959f94416746ddd558f681f (diff) | |
download | libmm-player-44dd8e4580d51997bd0c1a939379e68172f3c345.tar.gz libmm-player-44dd8e4580d51997bd0c1a939379e68172f3c345.tar.bz2 libmm-player-44dd8e4580d51997bd0c1a939379e68172f3c345.zip |
[0.6.72] Add checking duration when video bitrate update
Change-Id: I06fd729b1a1194a071fb5f45c76606c36aa09ae7
-rw-r--r-- | packaging/libmm-player.spec | 2 | ||||
-rw-r--r-- | src/mm_player_priv.c | 15 |
2 files changed, 11 insertions, 6 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 5d8cfa9..29d5cf3 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.71 +Version: 0.6.72 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index af906a6..57b1a03 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -473,8 +473,9 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag) if (stat(path, &sb) == 0) data_size = (guint64)sb.st_size; - } else if (MMPLAYER_IS_HTTP_STREAMING(player)) + } else if (MMPLAYER_IS_HTTP_STREAMING(player)) { data_size = player->http_content_size; + } LOGD("try to update bitrate : data_size = %lld", data_size); if (data_size) { @@ -482,11 +483,15 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag) guint64 msec_dur = 0; msec_dur = GST_TIME_AS_MSECONDS(player->duration); - bitrate = data_size * 8 * 1000 / msec_dur; - SECURE_LOGD("file size : %u, video bitrate = %llu", data_size, bitrate); - mm_attrs_set_int_by_name(attrs, "content_video_bitrate", bitrate); + if (msec_dur > 0) { + bitrate = data_size * 8 * 1000 / msec_dur; + SECURE_LOGD("file size : %u, video bitrate = %llu", data_size, bitrate); + mm_attrs_set_int_by_name(attrs, "content_video_bitrate", bitrate); - has_bitrate = TRUE; + has_bitrate = TRUE; + } else { + LOGD("player duration is less than 0"); + } } if (MMPLAYER_IS_RTSP_STREAMING(player)) { |