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 753920 - dvdlpcmdec: factor out common code to set output format into new function
dvdlpcmdec: factor out common code to set output format into new function
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal enhancement
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-21 10:08 UTC by HoonHee Lee
Modified: 2015-09-26 08:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dvdlpcmdec: add new function to setting format for audio (3.65 KB, patch)
2015-08-21 10:08 UTC, HoonHee Lee
accepted-commit_after_freeze Details | Review
Make a new function for setting valid channel and format (3.87 KB, patch)
2015-08-25 01:26 UTC, HoonHee Lee
none Details | Review
Factor out common code to set output format into new function (3.86 KB, patch)
2015-08-25 09:22 UTC, HoonHee Lee
committed Details | Review

Description HoonHee Lee 2015-08-21 10:08:30 UTC
Created attachment 309796 [details] [review]
dvdlpcmdec: add new function to setting format for audio

Dear All.
To setting format for audio is performed by when caps is received or parsing header  in dvdlpcmdec.
I fixed to add a new function to support common logic.
 
Please check and review this patch.
Comment 1 Nicolas Dufresne (ndufresne) 2015-08-23 14:27:42 UTC
Please, don't change the importance mark, this is reserved for maintainers usage only.
Comment 2 Sebastian Dröge (slomo) 2015-08-24 08:22:48 UTC
Comment on attachment 309796 [details] [review]
dvdlpcmdec: add new function to setting format for audio

Please provide a more descriptive commit message, saying that you added a new function doesn't really explain anything. Say why you did that (e.g. "Refactor caps negotiation into its own function") :)

Otherwise looks good
Comment 3 HoonHee Lee 2015-08-25 01:26:37 UTC
Created attachment 309938 [details] [review]
Make a new function for setting valid channel and format

Dear Sebastian and All.
Thanks for your comment and help.
 
As your comment, I updated commit message.
Please refer new patch file and review it.
Comment 4 HoonHee Lee 2015-08-25 09:22:05 UTC
Created attachment 309944 [details] [review]
Factor out common code to set output format into new function

Dear All
I updated commit message.
Please review it again.
Comment 5 Tim-Philipp Müller 2015-09-26 08:30:45 UTC
Thanks. When updating an existing patch in bugzilla, please also mark the previous version of the patch as obsolete by ticking the checkbox next to the old patch when attaching the new one, thanks.

I have pushed this with three very minor changes:

 - prefixed update_audio_formats with gst_dvdlpcmdec_
 - added the bug url to the commit message at the end
 - changed your clear-text name in 'Author'

commit d7f78391b4490b896df2f06d7c73676a7fc616f6
Author: HoonHee Lee <hoonhee.lee@lge.com>
Date:   Tue Aug 25 10:08:46 2015 +0900

    dvdlpcmdec: factor out common code to set output format into new function
    
    When caps event is recieved and header is changed, reordering channel
    and setting the default output format for audio are processed. These 2 of
    code are same. Thus, It is better to make a new function for these common
    code in terms of removing duplicated code, maintenance and expansion.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753920


I also noticed this while looking at the patch:

commit d57b0971987598c73ce96c9026d422c94712caae
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sat Sep 26 09:23:05 2015 +0100

    dvdlpcmdec: fix invalid read beyond channel position array
    
    We would always copy sizeof(sorted_position) bytes, which is
    for 8 channels, but if we have less than 8 channels the
    position array we copy from will only have allocated space
    for channel channels, so we would read beyond the input
    array in some cases.