After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753490 - audioecho: reallocate buffer on changing max_delay
audioecho: reallocate buffer on changing max_delay
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-11 04:22 UTC by Prashant Gotarne
Modified: 2015-08-16 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audioecho: buffer reallocated on changing max_delay property (989 bytes, patch)
2015-08-11 04:24 UTC, Prashant Gotarne
needs-work Details | Review
audioecho: patch to free buffer unconditionally (1.21 KB, patch)
2015-08-14 04:18 UTC, Prashant Gotarne
committed Details | Review

Description Prashant Gotarne 2015-08-11 04:22:17 UTC
self->buffer size is depend on the max_delay property.
Buffer is not reallocated on changing max_delay property.
Reallocate buffer if max_delay property is increased.
Comment 1 Prashant Gotarne 2015-08-11 04:24:05 UTC
Created attachment 309040 [details] [review]
audioecho: buffer reallocated on changing max_delay property

please review this patch
Comment 2 Tim-Philipp Müller 2015-08-13 13:32:27 UTC
Comment on attachment 309040 [details] [review]
audioecho: buffer reallocated on changing max_delay property

Thanks, makes sense.

Minor style issue: I think you should just free the buffer unconditionally here so that it always gets re-allocated with the new size.

The value of max_delay might also change in PROP_DELAY, so I think we should probably free the buffer there as well.
Comment 3 Prashant Gotarne 2015-08-14 04:18:02 UTC
Created attachment 309239 [details] [review]
audioecho: patch to free buffer unconditionally

Thanks for the review.
I kept it conditionally to avoid possible reallocations if max_delay is less than the old value.  

Also in PROP_DELAY case, max_delay value in else block will change only if element is in NULL state or READY state. In this case the buffer is already NULL so no need to do anything.

To minimize the memory usage your suggestion to free the buffer unconditionally is right :-) 
I will attach another patch as per your review comments. I will keep the older patch as it is; in case you want to go with the conditional approach to avoid reallocation.

Please review it.
Comment 4 Tim-Philipp Müller 2015-08-14 11:03:41 UTC
commit 0671ea85aff793df6cb7fd16ad26fad24501dc69
Author: Prashant Gotarne <ps.gotarne@samsung.com>
Date:   Fri Aug 14 09:36:09 2015 +0530

    audioecho: make sure buffer gets reallocated if max_delay changes
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753490