update http duration
authorYounghwan Ahn <younghwan_.an@samsung.com>
Thu, 15 Nov 2012 02:59:32 +0000 (02:59 +0000)
committerYounghwan Ahn <younghwan_.an@samsung.com>
Thu, 15 Nov 2012 03:02:10 +0000 (12:02 +0900)
src/mm_player_priv.c

index 5dc61ff..b7a68e8 100755 (executable)
@@ -1664,9 +1664,25 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                case GST_MESSAGE_DURATION:
                {
                        debug_log("GST_MESSAGE_DURATION\n");
-                       player->need_update_content_attrs = TRUE;
-                       player->need_update_content_dur = TRUE;
-                       _mmplayer_update_content_attrs(player);
+
+                       if (MMPLAYER_IS_STREAMING(player))
+                       {
+                               GstFormat format;
+                               gint64 bytes = 0;
+
+                               gst_message_parse_duration (msg, &format, &bytes);
+                               if (format == GST_FORMAT_BYTES)
+                               {
+                                       debug_log("data total size of http content: %lld", bytes);
+                                       player->http_content_size = bytes;
+                               }
+                       }
+                       else
+                       {
+                               player->need_update_content_attrs = TRUE;
+                               player->need_update_content_dur = TRUE;
+                               _mmplayer_update_content_attrs(player);
+                       }
                }
                break;