remove dead code 33/42933/1
authorHyunil Park <hyunil46.park@samsung.com>
Mon, 6 Jul 2015 06:33:30 +0000 (15:33 +0900)
committerHyunil Park <hyunil46.park@samsung.com>
Mon, 6 Jul 2015 06:33:30 +0000 (15:33 +0900)
Change-Id: I202614d6c71c1bbf90d240ad3538b5587db878b0
Signed-off-by: Hyunil Park <hyunil46.park@samsung.com>
src/mm_player_priv.c

index 7589711..be903d7 100755 (executable)
@@ -5841,6 +5841,7 @@ __mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket, gboolea
 
                if ( !player->set_mode.video_zc)
                {
+                       GstStructure *str = NULL;
                        gint width = 0;         //width of video
                        gint height = 0;                //height of video
                        GstCaps* video_caps = NULL;
@@ -5852,28 +5853,41 @@ __mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket, gboolea
                        MMPLAYER_CREATE_ELEMENT(player->pipeline->videobin, MMPLAYER_V_CAPS, "capsfilter", "videocapsfilter", TRUE, player);
 
                        /* get video stream caps parsed by demuxer */
+                       str = gst_caps_get_structure (player->v_stream_caps, 0);
+                       if ( !str )
+                       {
+                               debug_error("cannot get structure");
+                               goto ERROR;
+                       }
 
                        mm_attrs_get_int_by_name(player->attrs, "display_width", &width);
 
-                       if(width)
-                               structure = gst_structure_new("video/x-raw", "width", G_TYPE_INT, width, NULL);
+                       if (width) {
+                               if (structure) {
+                                       gst_structure_set (structure, "width", G_TYPE_INT, width, NULL);
+                               } else {
+                                       structure = gst_structure_new("video/x-raw", "width", G_TYPE_INT, width, NULL);
+                               }
+                       }
 
                        mm_attrs_get_int_by_name(player->attrs, "display_height", &height);
 
-                       if(structure && height) {
-                               gst_structure_set (structure, "height", G_TYPE_INT, height, NULL);
+                       if (height) {
+                               if (structure) {
+                                       gst_structure_set (structure, "height", G_TYPE_INT, height, NULL);
+                               } else {
+                                       structure = gst_structure_new("video/x-raw", "height", G_TYPE_INT, height, NULL);
+                               }
+                       }
 
+                       if (width || height) {
                                video_caps = gst_caps_new_full(structure, NULL);
+                               gst_structure_free(structure);
+
                                g_object_set (GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_CAPS].gst), "caps", video_caps, NULL );
                                MMPLAYER_LOG_GST_CAPS_TYPE(video_caps);
                                gst_caps_unref(video_caps);
                        }
-                       else
-                               debug_error("fail to set capsfilter %p, width %d, height %d", structure, width, height);
-
-                       if(structure)
-                               gst_structure_free(structure);
-
                }
        }
        else
@@ -11474,7 +11488,6 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
        MMPlayerGstElement* mainbin = NULL;
        GstElement* decodebin2 = NULL;
        GstElement* queue2 = NULL;
-       GstElement* id3demux = NULL;
        GstPad* sinkpad = NULL;
        GstPad* qsrcpad= NULL;
        gchar *caps_str = NULL;
@@ -11655,22 +11668,6 @@ ERROR:
                queue2 = NULL;
        }
 
-       if (id3demux)
-       {
-               /* NOTE : Trying to dispose element id3demux, but it is in READY instead of the NULL state.
-                * You need to explicitly set elements to the NULL state before
-                * dropping the final reference, to allow them to clean up.
-                */
-               gst_element_set_state(id3demux, GST_STATE_NULL);
-
-               /* And, it still has a parent "player".
-                * You need to let the parent manage the object instead of unreffing the object directly.
-                */
-               gst_bin_remove (GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), id3demux);
-               gst_object_unref (id3demux);
-               id3demux = NULL;
-       }
-
        if (decodebin2)
        {
                /* NOTE : Trying to dispose element queue0, but it is in READY instead of the NULL state.