Updated the examples exit if the pipeline doesn't want to go to the playing state.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 12 Dec 2001 18:31:25 +0000 (18:31 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 12 Dec 2001 18:31:25 +0000 (18:31 +0000)
Original commit message from CVS:
Updated the examples
exit if the pipeline doesn't want to go to the playing state.

tools/README
tools/gstreamer-launch.c

index 6771d23c6e095d3b751d0a5347d3b2f73960f0ed..d7585cc670390a9487508f4b5d3daeec82fa156f 100644 (file)
@@ -64,13 +64,13 @@ Record sound from your sound input and encode it into an ogg file:
 gstreamer-launch not only handles audio but video as well:
 For mpeg1 files (video and audio streams respectively):
 
- gstreamer-launch disksrc location=video.mpg ! mpeg1parse video_00! queue ! { mp1videoparse ! mpeg_play ! sdlvideosink }
- gstreamer-launch disksrc location=video.mpg ! mpeg1parse audio_00! queue ! { mad ! osssink }
+ gstreamer-launch disksrc location=video.mpg ! mpegdemux video_00! { queue ! mpeg2dec ! sdlvideosink }
+ gstreamer-launch disksrc location=video.mpg ! mpegdemux audio_00! { queue ! mad ! osssink }
 
 For mpeg2 files (video and audio streams respectively):
  
- gstreamer-launch disksrc location=video.mpeg ! mpeg2parse video_0! queue ! { mpeg2dec ! sdlvideosink }
- gstreamer-launch disksrc location=video.mpeg ! mpeg2parse private_stream_1.0! queue ! { ac3dec ! osssink }
+ gstreamer-launch disksrc location=video.mpeg ! mpegdemux video_00! { queue ! mpeg2dec ! sdlvideosink }
+ gstreamer-launch disksrc location=video.mpeg ! mpegdemux private_stream_1.0! { queue ! ac3dec ! osssink }
 
 Note: The types of audio streams in the mpeg files can vary!
  
index e50db14cbd74f69d3f6ba7bede5b080c9b8317c2..9d0a13c25d9f343c255b85f1270c993be93c29da 100644 (file)
@@ -167,7 +167,10 @@ main(int argc, char *argv[])
     arg_search(GST_BIN(pipeline),"xid",xid_handler,NULL);
 
     fprintf(stderr,"RUNNING pipeline\n");
-    gst_element_set_state (pipeline, GST_STATE_PLAYING);
+    if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS) {
+      fprintf(stderr,"pipeline doesn't want to play\n");
+      exit (-1);
+    }
 
     g_idle_add(idle_func,pipeline);
 #ifdef USE_GLIB2