Skip to content

Commit

Permalink
Revert "tests: examples: allow setting the video and audio sink in pl…
Browse files Browse the repository at this point in the history
…ayer"

This reverts commit 7d7e243.

I forget to check the GObject before unref it.

Signed-off-by: ayaka <[email protected]>
  • Loading branch information
hizukiayaka committed Jun 9, 2017
1 parent 7d7e243 commit bdbf312
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions tests/examples/player/ayamero-player.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ typedef struct _PlayerData
GstElement *pipeline;
GMainLoop *main_loop;
GList *playlist;
GstElement *vsink;
GstElement *asink;
} PlayerData;

static gboolean
Expand Down Expand Up @@ -177,19 +175,13 @@ main (gint argc, gchar * argv[])
GstBus *bus = NULL;
GError *err = NULL;

gchar *uri = NULL, *path = NULL, *vsink = NULL, *asink = NULL;
gchar *uri = NULL, *path = NULL;
GOptionEntry options[] = {
{"uri", '\0', 0, G_OPTION_ARG_STRING, &uri, "video source URI", NULL}
,
{"path", '\0', 0, G_OPTION_ARG_STRING, &path,
"the path of a video file or directory", NULL}
,
{"video-sink", '\0', 0, G_OPTION_ARG_STRING, &vsink,
"the video sink", NULL}
,
{"audio-sink", '\0', 0, G_OPTION_ARG_STRING, &asink,
"the audio sink", NULL}
,
{NULL}
};
GOptionContext *ctx;
Expand Down Expand Up @@ -221,16 +213,9 @@ main (gint argc, gchar * argv[])
uri = data.playlist->data;
}

if (vsink != NULL)
data.vsink = gst_element_factory_make (vsink, "video-sink");
if (asink != NULL)
data.asink = gst_element_factory_make (asink, "audio-sink");

data.main_loop = g_main_loop_new (NULL, FALSE);
data.pipeline = gst_element_factory_make ("playbin", "play");
g_object_set (G_OBJECT (data.pipeline), "uri", uri, NULL);
g_object_set (G_OBJECT (data.pipeline), "video-sink", data.vsink, NULL);
g_object_set (G_OBJECT (data.pipeline), "audio-sink", data.asink, NULL);

io_stdin = g_io_channel_unix_new (fileno (stdin));
g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc) keypress, (gpointer) & data);
Expand All @@ -246,8 +231,6 @@ main (gint argc, gchar * argv[])

gst_element_set_state (data.pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (data.pipeline));
gst_object_unref (GST_OBJECT (data.vsink));
gst_object_unref (GST_OBJECT (data.asink));

g_io_channel_unref (io_stdin);
gst_object_unref (bus);
Expand Down

0 comments on commit bdbf312

Please sign in to comment.