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) {
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)) {