From d61cbc8ea03776903a76658bf07dc6fcef7f6aac Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Dec 2001 18:31:25 +0000 Subject: [PATCH] Updated the examples exit if the pipeline doesn't want to go to the playing state. Original commit message from CVS: Updated the examples exit if the pipeline doesn't want to go to the playing state. --- tools/README | 8 ++++---- tools/gstreamer-launch.c | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/README b/tools/README index 6771d23..d7585cc 100644 --- a/tools/README +++ b/tools/README @@ -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! diff --git a/tools/gstreamer-launch.c b/tools/gstreamer-launch.c index e50db14..9d0a13c 100644 --- a/tools/gstreamer-launch.c +++ b/tools/gstreamer-launch.c @@ -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 -- 2.7.4