viewer: unload the image object and set background when playing video file 23/55723/1 accepted/tizen/tv/20151229.072524 submit/tizen/20151229.024340
authorMinkyu Kang <mk7.kang@samsung.com>
Tue, 29 Dec 2015 02:28:09 +0000 (11:28 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 29 Dec 2015 02:28:09 +0000 (11:28 +0900)
Change-Id: Ia3de121b1962a0e7cc54cd69102441cdd042303d
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
src/view/viewer.c

index 13ac8ed..6c7a389 100644 (file)
@@ -236,6 +236,23 @@ static void _set_bg_color(struct _priv *priv, int r, int g, int b, int a)
        elm_object_part_content_set(priv->base, PART_VIEWER_BG, bg);
 }
 
+static void _image_unload(struct _priv *priv)
+{
+        if (priv->photo_pre) {
+               evas_object_del(priv->photo_pre);
+               priv->photo_pre = NULL;
+        }
+
+        if (priv->photo) {
+               evas_object_del(priv->photo);
+               priv->photo = NULL;
+        }
+
+        _set_bg_color(priv, 0, 0, 0, 0);
+
+        elm_object_part_content_unset(priv->base, PART_VIEWER_CONTENT);
+}
+
 static void _image_loaded(void *data, Evas_Object *obj, void *ev)
 {
        struct _priv *priv;
@@ -274,9 +291,11 @@ static void _draw_contents(struct _priv *priv, int id, app_media_info *mi)
        Evas_Object *obj;
 
        if (id == VIEWER_MOVIE) {
+               _image_unload(priv);
                _player_play(priv);
                return;
        } else if (id == VIEWER_VIDEO) {
+               _image_unload(priv);
                _player_play(priv);
 
                if (!priv->slideshow.enable)