Commit a5211e14 authored by hark's avatar hark
Browse files

exit when element cannot be created

parent be6ec9ad
......@@ -25,22 +25,26 @@ all : c-player c-player-0.10 c-player-debug snowControl
#switchs: switchs.c
# gcc -DTESTING -DGTK -g switchs.c -o switchs `pkg-config --cflags --libs gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gtk+-2.0 gstreamer-0.10` $(CFLAGS)
PLAYERDEPS="main.c c-player.c snowbin.c playlist.c teebin.c wraps.c common.h playlist.h teebin.h"
c-player-0.10 : c-player.c main.c
$(CC) -DSNOWBIN -DFP -DPL -DGTK -g main.c c-player.c wraps.c playlist.c snowbin.c teebin.c -o c-player-0.10 `pkg-config --cflags --libs gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gtk+-2.0 gstreamer-0.10` $(CFLAGS)
c-player-debug : main.c c-player.c
c-player-debug : main.c c-player.c snowbin.c teebin.c wraps.c common.h c-player.h snowbin.h
$(CC) -DTT -DTESTING -DGTK -DGST1 -g main.c c-player.c wraps.c playlist.c snowbin.c teebin.c -o c-player-debug `pkg-config --cflags --libs gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
c-player-np : main.c c-player.c snowbin.c teebin.c wraps.c common.h
$(CC) -DGTK -DGST1 -g main.c c-player.c wraps.c snowbin.c teebin.c -o c-player-np `pkg-config --cflags --libs gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
c-player : main.c c-player.c snowbin.c playlist.c teebin.c wraps.c common.h playlist.h teebin.h
c-player : main.c c-player.c snowbin.c teebin.c wraps.c common.h c-player.h snowbin.h
$(CC) -DSNOWBIN -DFP -DPL -DGTK -DGST1 -g main.c c-player.c wraps.c playlist.c snowbin.c teebin.c -o c-player `pkg-config --cflags --libs gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
c-player-cli : main.c c-player.c snowbin.c teebin.c wraps.c common.h
$(CC) -DGST1 -g main.c c-player.c wraps.c snowbin.c teebin.c -o c-player-cli `pkg-config --cflags --libs gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
c-player-ns : main.c c-player.c snowbin.c teebin.c wraps.c common.h c-player.h snowbin.h
$(CC) -DFP -DPL -DGTK -DGST1 -g main.c c-player.c wraps.c playlist.c snowbin.c teebin.c -o c-player-ns `pkg-config --cflags --libs gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
c-player-cli : main.c c-player.c wraps.c snowbin.c teebin.c common.h
$(CC) -DGST1 -g main.c c-player.c wraps.c snowbin.c teebin.c -o c-player-cli `pkg-config --cflags --libs gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
......
......@@ -179,7 +179,7 @@ stop_cb (GtkButton * button, PlayerData * data)
}
#endif
static void
extern void
player_load_uri (const gchar * uri, PlayerData * data)
{
// this would stop playback, so don't do that
......
......@@ -154,7 +154,7 @@ struct PlayerGui {
GtkWidget *options; /* HBox to hold the options and current uri */
GtkWidget *play_button, *pause_button, *stop_button, *open_button, *add_button; /* Buttons */
GtkWidget *test_button, *previous_button, *next_button;
GtkWidget *label_time;
GtkWidget *loaded_label;
#endif
};
......
......@@ -23,7 +23,7 @@ main (int argc, char *argv[])
// feed, filename,
auto int opt = 0;
// auto int feedid = 1;
auto int audiosink = 23;
auto int audiosink = FAKE;
g_unix_signal_add(SIGUSR1, (GSourceFunc)signal_handler, pData);
g_unix_signal_add(SIGTERM, (GSourceFunc)signal_handler, pData);
g_unix_signal_add(SIGINT, (GSourceFunc)signal_handler, pData);
......
......@@ -468,6 +468,7 @@ get_snowaudiobin (snowData *sd)
printf("JACK \n ");
//jack
audiosink = get_jacksink(sd->currentFeed->id);
if (audiosink == NULL) { e_exit(" could not create element jacksink "); }
gst_bin_add_many (GST_BIN (snowaudiobin), audioconvert, audiosink,
NULL);
gst_element_link_many (audioconvert, audiosink, NULL);
......@@ -478,6 +479,7 @@ get_snowaudiobin (snowData *sd)
// snow
printf ("SNOW");
audiosink = get_snowaudiosink(sd->currentFeed->id);
if (audiosink == NULL) { e_exit(" could not create element snowaudiosink "); }
GstCaps *caps = gst_caps_new_simple ("audio/x-raw",
"rate", G_TYPE_INT, 4800,
......
......@@ -9,6 +9,14 @@
#include <strings.h>
#include <stdio.h>
extern void
e_exit (char * msg)
{
printf("EXITING: %s \n", msg);
exit(10);
}
extern GstElement *
gst_element_factory_make_debug( gchar *factoryname, gchar *name)
{
......@@ -19,6 +27,7 @@ gst_element_factory_make_debug( gchar *factoryname, gchar *name)
if (element == NULL) {
printf ("\n Failed to create element - type: %s name: %s \n", factoryname, name);
e_exit(factoryname);
return element;
} else {
return element;
......
......@@ -4,4 +4,6 @@ extern int wtf;
extern GstElement *
gst_element_factory_make_debug( gchar *factoryname, gchar *name);
extern void
e_exit (char *);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment