[gstreamermm] Examples and Tests: Return 1 on error instead of -1.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gstreamermm] Examples and Tests: Return 1 on error instead of -1.
- Date: Fri, 16 Oct 2009 06:03:50 +0000 (UTC)
commit 4fc0cc96e90f1ff0429489f98718e5f16fe4d4a1
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Fri Oct 16 01:40:47 2009 -0400
Examples and Tests: Return 1 on error instead of -1.
* examples/media_player_gtkmm/main.cc:
* examples/ogg_player_gtkmm/main.cc:
* examples/typefind/main.cc:
* tests/test-init-check-noargs.cc:
* tests/test-init-check.cc:
* tests/test-plugin-signals.cc:
* tests/test-property-caps.cc: Use a return of 1 for errors instead of
a -1.
* gstreamer/src/xml.ccg: Typo.
ChangeLog | 15 +++++++++++++++
examples/media_player_gtkmm/main.cc | 4 ++--
examples/ogg_player_gtkmm/main.cc | 12 ++++++------
examples/typefind/main.cc | 2 +-
gstreamer/src/xml.ccg | 2 +-
tests/test-init-check-noargs.cc | 4 ++--
tests/test-init-check.cc | 4 ++--
tests/test-plugin-signals.cc | 4 ++--
tests/test-property-caps.cc | 2 +-
9 files changed, 32 insertions(+), 17 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ce9b53f..581a9e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2009-10-16 José Alburquerque <jaalburqu svn gnome org>
+ Examples and Tests: Return 1 on error instead of -1.
+
+ * examples/media_player_gtkmm/main.cc:
+ * examples/ogg_player_gtkmm/main.cc:
+ * examples/typefind/main.cc:
+ * tests/test-init-check-noargs.cc:
+ * tests/test-init-check.cc:
+ * tests/test-plugin-signals.cc:
+ * tests/test-property-caps.cc: Use a return of 1 for errors instead of
+ a -1.
+
+ * gstreamer/src/xml.ccg: Typo.
+
+2009-10-16 José Alburquerque <jaalburqu svn gnome org>
+
Use C++ style casts instead of C casts.
* gstreamer/src/audioclock.ccg:
diff --git a/examples/media_player_gtkmm/main.cc b/examples/media_player_gtkmm/main.cc
index 42cffaa..bf94ed8 100644
--- a/examples/media_player_gtkmm/main.cc
+++ b/examples/media_player_gtkmm/main.cc
@@ -44,7 +44,7 @@ main (int argc, char *argv[])
if(!playbin)
{
std::cerr << "The playbin could not be created." << std::endl;
- return -1;
+ return 1;
}
// Create a video sink where video (if any) will be drawn:
@@ -53,7 +53,7 @@ main (int argc, char *argv[])
if(!video_sink)
{
std::cerr << "The ximagesink could not be created." << std::endl;
- return -1;
+ return 1;
}
// Set the playbin's video-sink property so that our video sink is used
diff --git a/examples/ogg_player_gtkmm/main.cc b/examples/ogg_player_gtkmm/main.cc
index 201b2f5..8ac33d8 100644
--- a/examples/ogg_player_gtkmm/main.cc
+++ b/examples/ogg_player_gtkmm/main.cc
@@ -63,7 +63,7 @@ main (int argc, char *argv[])
if(!source)
{
std::cerr << "filesrc element could not be created" << std::endl;
- return -1;
+ return 1;
}
// Parses the ogg streams into elementary streams (note that an ogg file may
@@ -72,7 +72,7 @@ main (int argc, char *argv[])
if(!parser)
{
std::cerr << "oggdemux element could not be created" << std::endl;
- return -1;
+ return 1;
}
// Decodes a vorbis stream
@@ -80,7 +80,7 @@ main (int argc, char *argv[])
if(!decoder)
{
std::cerr << "vorbisdec element could not be created" << std::endl;
- return -1;
+ return 1;
}
// Converts audio to a format which can be used by the next element
@@ -88,7 +88,7 @@ main (int argc, char *argv[])
if(!conv)
{
std::cerr << "audioconvert element could not be created" << std::endl;
- return -1;
+ return 1;
}
// Outputs sound to an ALSA audio device
@@ -96,7 +96,7 @@ main (int argc, char *argv[])
if(!sink)
{
std::cerr << "sink element could not be created" << std::endl;
- return -1;
+ return 1;
}
@@ -111,7 +111,7 @@ main (int argc, char *argv[])
catch(const std::runtime_error& ex)
{
std::cerr << "Error while adding elements to the pipeline: " << ex.what() << std::endl;
- return -1;
+ return 1;
}
#endif
diff --git a/examples/typefind/main.cc b/examples/typefind/main.cc
index dc10c80..07b751b 100644
--- a/examples/typefind/main.cc
+++ b/examples/typefind/main.cc
@@ -71,7 +71,7 @@ int main(int argc, char** argv)
if(argc < 2)
{
std::cout << "Usage: " << argv[0] << " <filename>" << std::endl;
- return -1;
+ return 1;
}
const std::string filename = argv[1];
diff --git a/gstreamer/src/xml.ccg b/gstreamer/src/xml.ccg
index 52527fb..60260cb 100644
--- a/gstreamer/src/xml.ccg
+++ b/gstreamer/src/xml.ccg
@@ -45,7 +45,7 @@ void XML::write_to_stream(const Glib::RefPtr<const Gst::Element>& element, std::
bool XML::parse_memory(const std::string& buffer, const Glib::ustring& root)
{
- return gst_xml_parse_memory(this->gobj(),
+ return gst_xml_parse_memory(gobj(),
reinterpret_cast<guchar*>(const_cast<char*>(buffer.c_str())),
buffer.size(), root.c_str());
}
diff --git a/tests/test-init-check-noargs.cc b/tests/test-init-check-noargs.cc
index cda5dd6..54649a0 100644
--- a/tests/test-init-check-noargs.cc
+++ b/tests/test-init-check-noargs.cc
@@ -30,14 +30,14 @@ int main (int argc, char* argv[])
if(!success)
{
std::cout << "Error initializing gstreamermm." << std::endl;
- return -1;
+ return 1;
}
}
catch(const Glib::Error& error)
{
std::cout << "Error initializing gstreamermm." << std::endl;
- return -1;
+ return 1;
}
#else
std::auto_ptr<Glib::Error> error;
diff --git a/tests/test-init-check.cc b/tests/test-init-check.cc
index f8edd52..856a05b 100644
--- a/tests/test-init-check.cc
+++ b/tests/test-init-check.cc
@@ -31,13 +31,13 @@ int main (int argc, char* argv[])
if(!success)
{
std::cout << "Error initializing gstreamermm." << std::endl;
- return -1;
+ return 1;
}
}
catch(const Glib::Error& error)
{
std::cout << "Error initializing gstreamermm." << std::endl;
- return -1;
+ return 1;
}
#else
std::auto_ptr<Glib::Error> error;
diff --git a/tests/test-plugin-signals.cc b/tests/test-plugin-signals.cc
index 5277a36..d6ef1fe 100644
--- a/tests/test-plugin-signals.cc
+++ b/tests/test-plugin-signals.cc
@@ -78,7 +78,7 @@ int main(int argc, char* argv[])
if(!pipeline || !source || !sink) {
std::cerr << "One element could not be created" << std::endl;
- return -1;
+ return 1;
}
// Put all elements in a bin:
@@ -94,7 +94,7 @@ int main(int argc, char* argv[])
std::cerr << "Error while adding elements to the pipeline: " <<
ex.what() << std::endl;
- return -1;
+ return 1;
}
#endif
diff --git a/tests/test-property-caps.cc b/tests/test-property-caps.cc
index 6cbc485..13bfe21 100644
--- a/tests/test-property-caps.cc
+++ b/tests/test-property-caps.cc
@@ -33,7 +33,7 @@ main(int argc, char* argv[])
std::cout << "Could not create `multifilesrc' element. Exiting." <<
std::endl;
- return -1;
+ return 1;
}
Glib::RefPtr<Gst::Caps> caps;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]