test: fix for new-sample signature

The new-sample signal expects a GstFlowReturn as a result.
Add support for external subtitles as well.
This commit is contained in:
Wim Taymans 2012-09-26 13:22:09 +02:00
parent 6973a66813
commit 65b06e18ac

View File

@ -83,7 +83,7 @@ bus_message (GstBus * bus, GstMessage * message, App * app)
return TRUE; return TRUE;
} }
static void static GstFlowReturn
have_subtitle (GstElement * appsink, App * app) have_subtitle (GstElement * appsink, App * app)
{ {
GstBuffer *buffer; GstBuffer *buffer;
@ -117,6 +117,7 @@ have_subtitle (GstElement * appsink, App * app)
gst_buffer_unmap (buffer, &map); gst_buffer_unmap (buffer, &map);
gst_sample_unref (sample); gst_sample_unref (sample);
} }
return GST_FLOW_OK;
} }
int int
@ -129,7 +130,7 @@ main (int argc, char *argv[])
gst_init (&argc, &argv); gst_init (&argc, &argv);
if (argc < 2) { if (argc < 2) {
g_print ("usage: %s <filename>\n", argv[0]); g_print ("usage: %s <uri> [<suburi>]\n", argv[0]);
return -1; return -1;
} }
@ -159,6 +160,9 @@ main (int argc, char *argv[])
/* set to read from appsrc */ /* set to read from appsrc */
g_object_set (app->playbin, "uri", argv[1], NULL); g_object_set (app->playbin, "uri", argv[1], NULL);
if (argc > 2)
g_object_set (app->playbin, "suburi", argv[2], NULL);
/* go to playing and wait in a mainloop. */ /* go to playing and wait in a mainloop. */
gst_element_set_state (app->playbin, GST_STATE_PLAYING); gst_element_set_state (app->playbin, GST_STATE_PLAYING);