[gstreamermm] Avoid compiler warning in ogg_player example
- From: Daniel Elstner <daniel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gstreamermm] Avoid compiler warning in ogg_player example
- Date: Tue, 6 Oct 2009 12:26:17 +0000 (UTC)
commit 41d761c2c09363cbb06998032382081bdbac929b
Author: Daniel Elstner <danielk openismus com>
Date: Tue Oct 6 14:23:40 2009 +0200
Avoid compiler warning in ogg_player example
* examples/ogg_player/main.cc: Place file-scope declarations into
an anonymous namespace.
(on_sink_pad_have_data): Remove unused parameter name to get rid of
a compiler warning.
(main): Return exit code 1 rather than -1 on failure.
ChangeLog | 10 ++++++++++
examples/ogg_player/main.cc | 17 +++++++++++------
2 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e802119..de91672 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2009-10-06 Daniel Elstner <danielk openismus com>
+ Avoid compiler warning in ogg_player example
+
+ * examples/ogg_player/main.cc: Place file-scope declarations into
+ an anonymous namespace.
+ (on_sink_pad_have_data): Remove unused parameter name to get rid of
+ a compiler warning.
+ (main): Return exit code 1 rather than -1 on failure.
+
+2009-10-06 Daniel Elstner <danielk openismus com>
+
Harden TypeFind code and avoid compiler warning
* gstreamer/src/typefind.ccg: Place file-scope declarations into an
diff --git a/examples/ogg_player/main.cc b/examples/ogg_player/main.cc
index f90987a..7efe982 100644
--- a/examples/ogg_player/main.cc
+++ b/examples/ogg_player/main.cc
@@ -20,6 +20,9 @@
#include <iostream>
#include <iomanip>
+namespace
+{
+
Glib::RefPtr<Glib::MainLoop> mainloop;
Glib::RefPtr<Gst::Pipeline> pipeline;
Glib::RefPtr<Gst::Element> decoder;
@@ -108,7 +111,7 @@ void on_parser_pad_added(const Glib::RefPtr<Gst::Pad>& newPad)
}
bool on_sink_pad_have_data(const Glib::RefPtr<Gst::Pad>& pad,
- const Glib::RefPtr<Gst::MiniObject>& data)
+ const Glib::RefPtr<Gst::MiniObject>&)
{
std::cout << "Sink pad '" << pad->get_name() << "' has received data;";
std::cout << " will now remove sink data probe id: " << data_probe_id << std::endl;
@@ -116,6 +119,8 @@ bool on_sink_pad_have_data(const Glib::RefPtr<Gst::Pad>& pad,
return true;
}
+} // anonymous namespace
+
int main(int argc, char* argv[])
{
// Initialize Gstreamermm:
@@ -125,7 +130,7 @@ int main(int argc, char* argv[])
if(argc < 2)
{
std::cout << "Usage: " << argv[0] << " <Ogg/Vorbis filename>" << std::endl;
- return -1;
+ return 1;
}
const std::string filename = argv[1];
@@ -166,7 +171,7 @@ int main(int argc, char* argv[])
if(!pipeline || !source || !parser || !decoder || !conv || !sink)
{
std::cerr << "One element could not be created" << std::endl;
- return -1;
+ return 1;
}
Glib::RefPtr<Gst::Pad> pad = sink->get_static_pad("sink");
@@ -176,7 +181,7 @@ int main(int argc, char* argv[])
source->set_property("location", filename);
- // Get the bus from the pipeline,
+ // Get the bus from the pipeline,
// and add a bus watch to the default main context with the default priority:
Glib::RefPtr<Gst::Bus> bus = pipeline->get_bus();
bus->add_watch( sigc::ptr_fun(&on_bus_message) );
@@ -193,7 +198,7 @@ int main(int argc, char* argv[])
catch(const Glib::Error& ex)
{
std::cerr << "Error while adding elements to the pipeline: " << ex.what() << std::endl;
- return -1;
+ return 1;
}
#endif
@@ -204,7 +209,7 @@ int main(int argc, char* argv[])
#endif
source->link(parser);
- // We cannot link the parser and decoder yet,
+ // We cannot link the parser and decoder yet,
// because the parser uses dynamic pads.
// So we do it later in a pad-added signal handler:
parser->signal_pad_added().connect( sigc::ptr_fun(&on_parser_pad_added) );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]