mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
gst/: fix a bunch of unchecked return values
Original commit message from CVS: * gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush): * gst/gstutils.c: (gst_util_set_value_from_string), (gst_util_set_object_arg): fix a bunch of unchecked return values * tools/gst-complete.c: (main): * gstreamer.spec.in: clean up a little
This commit is contained in:
parent
acf7a37eeb
commit
57efe08cd0
6 changed files with 69 additions and 48 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2005-09-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
|
||||
* gst/gstutils.c: (gst_util_set_value_from_string),
|
||||
(gst_util_set_object_arg):
|
||||
fix a bunch of unchecked return values
|
||||
* tools/gst-complete.c: (main):
|
||||
* gstreamer.spec.in:
|
||||
clean up a little
|
||||
|
||||
2005-09-01 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit b0ee0e4262014001faceb47d71c3a44c75ab86b4
|
||||
Subproject commit cd012821aa2e4f6247f4cd6dee14116f86421a7e
|
|
@ -111,7 +111,8 @@ gst_trace_flush (GstTrace * trace)
|
|||
return;
|
||||
}
|
||||
|
||||
write (trace->fd, trace->buf, trace->bufoffset * sizeof (GstTraceEntry));
|
||||
g_return_if_fail (write (trace->fd, trace->buf,
|
||||
trace->bufoffset * sizeof (GstTraceEntry)) != -1);
|
||||
trace->bufoffset = 0;
|
||||
}
|
||||
|
||||
|
@ -133,7 +134,7 @@ gst_trace_text_flush (GstTrace * trace)
|
|||
g_snprintf (str, STRSIZE, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
|
||||
trace->buf[i].timestamp,
|
||||
trace->buf[i].sequence, trace->buf[i].data, trace->buf[i].message);
|
||||
write (trace->fd, str, strlen (str));
|
||||
g_return_if_fail (write (trace->fd, str, strlen (str)) != -1);
|
||||
}
|
||||
trace->bufoffset = 0;
|
||||
#undef STRSIZE
|
||||
|
|
|
@ -102,28 +102,28 @@ gst_util_set_value_from_string (GValue * value, const gchar * value_str)
|
|||
case G_TYPE_INT:{
|
||||
gint i;
|
||||
|
||||
sscanf (value_str, "%d", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%d", &i) == 1);
|
||||
g_value_set_int (value, i);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_UINT:{
|
||||
guint i;
|
||||
|
||||
sscanf (value_str, "%u", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%u", &i) == 1);
|
||||
g_value_set_uint (value, i);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_LONG:{
|
||||
glong i;
|
||||
|
||||
sscanf (value_str, "%ld", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%ld", &i) == 1);
|
||||
g_value_set_long (value, i);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_ULONG:{
|
||||
gulong i;
|
||||
|
||||
sscanf (value_str, "%lu", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%lu", &i) == 1);
|
||||
g_value_set_ulong (value, i);
|
||||
break;
|
||||
}
|
||||
|
@ -138,28 +138,28 @@ gst_util_set_value_from_string (GValue * value, const gchar * value_str)
|
|||
case G_TYPE_CHAR:{
|
||||
gchar i;
|
||||
|
||||
sscanf (value_str, "%c", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%c", &i) == 1);
|
||||
g_value_set_char (value, i);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_UCHAR:{
|
||||
guchar i;
|
||||
|
||||
sscanf (value_str, "%c", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%c", &i) == 1);
|
||||
g_value_set_uchar (value, i);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_FLOAT:{
|
||||
gfloat i;
|
||||
|
||||
sscanf (value_str, "%f", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%f", &i) == 1);
|
||||
g_value_set_float (value, i);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_DOUBLE:{
|
||||
gfloat i;
|
||||
|
||||
sscanf (value_str, "%g", &i);
|
||||
g_return_if_fail (sscanf (value_str, "%g", &i) == 1);
|
||||
g_value_set_double (value, (gdouble) i);
|
||||
break;
|
||||
}
|
||||
|
@ -203,28 +203,28 @@ gst_util_set_object_arg (GObject * object, const gchar * name,
|
|||
case G_TYPE_INT:{
|
||||
gint i;
|
||||
|
||||
sscanf (value, "%d", &i);
|
||||
g_return_if_fail (sscanf (value, "%d", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_UINT:{
|
||||
guint i;
|
||||
|
||||
sscanf (value, "%u", &i);
|
||||
g_return_if_fail (sscanf (value, "%u", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_LONG:{
|
||||
glong i;
|
||||
|
||||
sscanf (value, "%ld", &i);
|
||||
g_return_if_fail (sscanf (value, "%ld", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_ULONG:{
|
||||
gulong i;
|
||||
|
||||
sscanf (value, "%lu", &i);
|
||||
g_return_if_fail (sscanf (value, "%lu", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
|
@ -239,28 +239,28 @@ gst_util_set_object_arg (GObject * object, const gchar * name,
|
|||
case G_TYPE_CHAR:{
|
||||
gchar i;
|
||||
|
||||
sscanf (value, "%c", &i);
|
||||
g_return_if_fail (sscanf (value, "%c", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_UCHAR:{
|
||||
guchar i;
|
||||
|
||||
sscanf (value, "%c", &i);
|
||||
g_return_if_fail (sscanf (value, "%c", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_FLOAT:{
|
||||
gfloat i;
|
||||
|
||||
sscanf (value, "%f", &i);
|
||||
g_return_if_fail (sscanf (value, "%f", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
break;
|
||||
}
|
||||
case G_TYPE_DOUBLE:{
|
||||
gfloat i;
|
||||
|
||||
sscanf (value, "%g", &i);
|
||||
g_return_if_fail (sscanf (value, "%g", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, (gdouble) i, NULL);
|
||||
break;
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ gst_util_set_object_arg (GObject * object, const gchar * name,
|
|||
if (G_IS_PARAM_SPEC_ENUM (paramspec)) {
|
||||
gint i;
|
||||
|
||||
sscanf (value, "%d", &i);
|
||||
g_return_if_fail (sscanf (value, "%d", &i) == 1);
|
||||
g_object_set (G_OBJECT (object), name, i, NULL);
|
||||
} else if (paramspec->value_type == GST_TYPE_URI) {
|
||||
g_object_set (G_OBJECT (object), name, value, NULL);
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
%define majorminor @GST_MAJORMINOR@
|
||||
%define gstreamer gstreamer09
|
||||
|
||||
Name: gstreamer09
|
||||
Name: %{gstreamer}
|
||||
Version: @VERSION@
|
||||
Release: @GST_VERSION_RELEASE@
|
||||
Summary: GStreamer streaming media framework runtime.
|
||||
|
||||
Group: Libraries/Multimedia
|
||||
Group: Applications/Multimedia
|
||||
License: LGPL
|
||||
URL: http://gstreamer.net/
|
||||
URL: http://gstreamer.freedesktop.org/
|
||||
Vendor: GStreamer Backpackers Team <package@gstreamer.net>
|
||||
Source: http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
@ -27,12 +28,14 @@ BuildRequires: libxml2-devel >= %_libxml2
|
|||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
BuildRequires: m4
|
||||
BuildRequires: check
|
||||
BuildRequires: gtk-doc >= 1.1
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: popt > 1.6
|
||||
Prereq: /sbin/ldconfig
|
||||
Requires(pre): /sbin/ldconfig
|
||||
Requires(post): /sbin/ldconfig
|
||||
|
||||
### documentation requirements
|
||||
BuildRequires: python2
|
||||
|
@ -56,13 +59,12 @@ types or processing capabilities can be added simply by installing new
|
|||
plugins.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries/include files for GStreamer streaming media framework.
|
||||
Summary: Libraries/include files for GStreamer streaming media framework
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: glib2-devel >= %_glib2
|
||||
Requires: libxml2-devel >= %_libxml2
|
||||
Provides: gstreamer-devel09 = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
GStreamer is a streaming-media framework, based on graphs of filters which
|
||||
|
@ -75,11 +77,11 @@ plugins.
|
|||
This package contains the libraries and includes files necessary to develop
|
||||
applications and plugins for GStreamer.
|
||||
|
||||
%package -n gstreamer09-tools
|
||||
Summary: tools for GStreamer streaming media framework.
|
||||
Group: Libraries/Multimedia
|
||||
%package -n gstreamer-tools
|
||||
Summary: tools for GStreamer streaming media framework
|
||||
Group: Applications/Multimedia
|
||||
|
||||
%description -n gstreamer09-tools
|
||||
%description -n gstreamer-tools
|
||||
GStreamer is a streaming-media framework, based on graphs of filters which
|
||||
operate on media data. Applications using this library can do anything
|
||||
from real-time sound processing to playing videos, and just about anything
|
||||
|
@ -91,29 +93,29 @@ This package contains wrapper scripts for the command-line tools that work
|
|||
with different major/minor versions of GStreamer.
|
||||
|
||||
%prep
|
||||
%setup -n gstreamer-%{version}
|
||||
%setup -q -n gstreamer-%{version}
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--enable-debug \
|
||||
--with-cachedir=%{_localstatedir}/cache/gstreamer-%{majorminor} \
|
||||
--disable-tests --disable-examples --disable-docs-build
|
||||
--disable-tests --disable-examples
|
||||
|
||||
make ERROR_CFLAGS=""
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
# build documentation to a different location so it doesn't end up in
|
||||
# a gstreamer-devel-(version) dir and doesn't get deleted by %doc scripts
|
||||
%makeinstall docdir=$RPM_BUILD_ROOT%{_datadir}/gstreamer-%{majorminor}/doc
|
||||
|
||||
# Install doc temporarily in order to be included later by rpm
|
||||
%makeinstall docdir="`pwd`/installed-doc"
|
||||
|
||||
%find_lang gstreamer-%{majorminor}
|
||||
# Clean out files that should not be part of the rpm.
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.la
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.a
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
|
||||
# Create empty cache directory
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/gstreamer-%{majorminor}
|
||||
|
||||
|
@ -122,10 +124,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%{_bindir}/gst-register-%{majorminor} > /dev/null 2> /dev/null
|
||||
%{_bindir}/gst-register-%{majorminor} > /dev/null 2>&1 || true
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files -f gstreamer-%{majorminor}.lang
|
||||
%defattr(-, root, root, -)
|
||||
|
@ -134,12 +135,12 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_libdir}/libgstreamer-%{majorminor}.so.*
|
||||
%{_libdir}/libgstbase-%{majorminor}.so.*
|
||||
%{_libdir}/libgstcontroller-%{majorminor}.so.*
|
||||
%{_libdir}/libgstdataprotocol-%{majorminor}.so.*
|
||||
|
||||
%dir %{_libdir}/gstreamer-%{majorminor}
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstelements.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstgetbits.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstindexers.so
|
||||
%{_libdir}/libgstdataprotocol-%{majorminor}.so
|
||||
|
||||
%{_bindir}/gst-complete-%{majorminor}
|
||||
%{_bindir}/gst-compprep-%{majorminor}
|
||||
|
@ -164,7 +165,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||
|
||||
%dir %{_localstatedir}/cache/gstreamer-%{majorminor}
|
||||
|
||||
%files -n gstreamer09-tools
|
||||
%files -n gstreamer-tools
|
||||
%defattr(-, root, root, -)
|
||||
%{_bindir}/gst-complete
|
||||
%{_bindir}/gst-compprep
|
||||
|
@ -179,28 +180,33 @@ rm -rf $RPM_BUILD_ROOT
|
|||
|
||||
%files devel
|
||||
%defattr(-, root, root, -)
|
||||
%doc installed-doc/*
|
||||
%dir %{_includedir}/gstreamer-%{majorminor}
|
||||
%dir %{_includedir}/gstreamer-%{majorminor}/gst
|
||||
%{_includedir}/gstreamer-%{majorminor}/gst/*.h
|
||||
%{_includedir}/gstreamer-%{majorminor}/gst/controller/gst-controller.h
|
||||
|
||||
%{_includedir}/gstreamer-%{majorminor}/gst/base
|
||||
%{_includedir}/gstreamer-%{majorminor}/gst/check
|
||||
%{_includedir}/gstreamer-%{majorminor}/gst/dataprotocol
|
||||
%{_includedir}/gstreamer-%{majorminor}/gst/getbits
|
||||
|
||||
%{_libdir}/libgstdataprotocol-%{majorminor}.so.*
|
||||
%{_libdir}/libgstdataprotocol-%{majorminor}.so
|
||||
%{_libdir}/libgstreamer-%{majorminor}.so
|
||||
%{_libdir}/libgstbase-%{majorminor}.so
|
||||
%{_libdir}/libgstcontroller-%{majorminor}.so
|
||||
|
||||
%{_libdir}/libgstcheck-%{majorminor}.so*
|
||||
|
||||
%{_datadir}/aclocal/gst-element-check-%{majorminor}.m4
|
||||
%{_libdir}/pkgconfig/gstreamer-%{majorminor}.pc
|
||||
%{_libdir}/pkgconfig/gstreamer-base-%{majorminor}.pc
|
||||
%{_libdir}/pkgconfig/gstreamer-dataprotocol-%{majorminor}.pc
|
||||
%{_libdir}/pkgconfig/gstreamer-controller-%{majorminor}.pc
|
||||
%{_libdir}/pkgconfig/gstreamer-check-%{majorminor}.pc
|
||||
|
||||
# %doc %{_datadir}/gtk-doc/html/gstreamer-%{majorminor}
|
||||
# %doc %{_datadir}/gtk-doc/html/gstreamer-libs-%{majorminor}
|
||||
%doc %{_datadir}/gtk-doc/html/gstreamer-%{majorminor}
|
||||
%doc %{_datadir}/gtk-doc/html/gstreamer-libs-%{majorminor}
|
||||
|
||||
%changelog
|
||||
* Thu Jun 09 2005 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
|
|
@ -145,9 +145,13 @@ main (int argc, char *argv[])
|
|||
} else if (!strcmp ((char *) argnode->name, "option")) {
|
||||
argument->type = ARG_ENUM;
|
||||
option = g_new0 (enum_value, 1);
|
||||
sscanf ((char *) xmlNodeGetContent (argnode), "%d",
|
||||
&option->value);
|
||||
argument->enums = g_slist_prepend (argument->enums, option);
|
||||
if (sscanf ((char *) xmlNodeGetContent (argnode), "%d",
|
||||
&option->value) != 1) {
|
||||
g_warning ("Could not read option");
|
||||
g_free (option);
|
||||
} else {
|
||||
argument->enums = g_slist_prepend (argument->enums, option);
|
||||
}
|
||||
}
|
||||
argnode = argnode->next;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue