gst/elements/gstfilesrc.c: Fix broken handling of mmapsize property. Remove useless g_object_notify(). Fixes #171400.

Original commit message from CVS:
Reviewed by: Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
* gst/elements/gstfilesrc.c: (gst_filesrc_set_property):
Fix broken handling of mmapsize property. Remove useless
g_object_notify(). Fixes #171400.
This commit is contained in:
Ronald S. Bultje 2005-03-23 22:12:58 +00:00
parent b27ab8bfb5
commit ccd1b69b71
3 changed files with 21 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2005-03-23 Tristan van Berkom <tristan.van.berkom@gmail.com>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/elements/gstfilesrc.c: (gst_filesrc_set_property):
Fix broken handling of mmapsize property. Remove useless
g_object_notify(). Fixes #171400.
2005-03-23 Stefan Kost <ensonic@users.sf.net>
* tools/gst-inspect.c: (print_interfaces), (print_element_info):

View file

@ -320,6 +320,7 @@ gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
GParamSpec * pspec)
{
GstFileSrc *src;
gulong ul;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_FILESRC (object));
@ -332,21 +333,19 @@ gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
break;
case ARG_BLOCKSIZE:
src->block_size = g_value_get_ulong (value);
g_object_notify (G_OBJECT (src), "blocksize");
break;
case ARG_MMAPSIZE:
if ((src->mapsize % src->pagesize) == 0) {
src->mapsize = g_value_get_ulong (value);
g_object_notify (G_OBJECT (src), "mmapsize");
ul = g_value_get_ulong (value);
if ((ul % src->pagesize) == 0) {
src->mapsize = ul;
} else {
GST_INFO_OBJECT (src,
"invalid mapsize, must be a multiple of pagesize, which is %d",
src->pagesize);
"invalid mapsize %d, must be a multiple of pagesize, which is %d",
ul, src->pagesize);
}
break;
case ARG_TOUCH:
src->touch = g_value_get_boolean (value);
g_object_notify (G_OBJECT (src), "touch");
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);

View file

@ -320,6 +320,7 @@ gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
GParamSpec * pspec)
{
GstFileSrc *src;
gulong ul;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_FILESRC (object));
@ -332,21 +333,19 @@ gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
break;
case ARG_BLOCKSIZE:
src->block_size = g_value_get_ulong (value);
g_object_notify (G_OBJECT (src), "blocksize");
break;
case ARG_MMAPSIZE:
if ((src->mapsize % src->pagesize) == 0) {
src->mapsize = g_value_get_ulong (value);
g_object_notify (G_OBJECT (src), "mmapsize");
ul = g_value_get_ulong (value);
if ((ul % src->pagesize) == 0) {
src->mapsize = ul;
} else {
GST_INFO_OBJECT (src,
"invalid mapsize, must be a multiple of pagesize, which is %d",
src->pagesize);
"invalid mapsize %d, must be a multiple of pagesize, which is %d",
ul, src->pagesize);
}
break;
case ARG_TOUCH:
src->touch = g_value_get_boolean (value);
g_object_notify (G_OBJECT (src), "touch");
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);