playback/player: gst-play: Check if the stream list is empty in print_all_stream_info before using it

This commit is contained in:
Jimmy Ohn 2015-08-26 18:57:13 +09:00 committed by Sebastian Dröge
parent e2581982a6
commit 50099a3aa1

View file

@ -195,9 +195,12 @@ static void
print_all_stream_info (GstPlayerMediaInfo * media_info) print_all_stream_info (GstPlayerMediaInfo * media_info)
{ {
guint count = 0; guint count = 0;
GList *l, *list; GList *list, *l;
list = gst_player_media_info_get_stream_list (media_info); list = gst_player_media_info_get_stream_list (media_info);
if (!list)
return;
g_print ("URI : %s\n", gst_player_media_info_get_uri (media_info)); g_print ("URI : %s\n", gst_player_media_info_get_uri (media_info));
g_print ("Duration: %" GST_TIME_FORMAT "\n", g_print ("Duration: %" GST_TIME_FORMAT "\n",
GST_TIME_ARGS (gst_player_media_info_get_duration (media_info))); GST_TIME_ARGS (gst_player_media_info_get_duration (media_info)));