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 736797 - audio: correct condition for MPEG case in iec61937 / SPDIF payloader
audio: correct condition for MPEG case in iec61937 / SPDIF payloader
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-17 12:46 UTC by Anuj
Modified: 2014-09-27 10:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audio: correct condition for MPEG case. (993 bytes, patch)
2014-09-17 12:46 UTC, Anuj
accepted-commit_now Details | Review
audio: Fixes for MPEG-2 LSF IEC61937 payloading (1.49 KB, patch)
2014-09-24 14:46 UTC, Arun Raghavan
needs-work Details | Review
audio: Fixes for MPEG-2 LSF IEC61937 payloading (2.25 KB, patch)
2014-09-24 15:11 UTC, Arun Raghavan
none Details | Review
audio: Trivial comment for unhandled MPEG-2 payloading case (1.18 KB, patch)
2014-09-24 15:12 UTC, Arun Raghavan
none Details | Review
audio: Trivial comment for unhandled MPEG-2 payloading case (1.39 KB, patch)
2014-09-27 05:10 UTC, Arun Raghavan
committed Details | Review
audio: Fixes for MPEG-2 LSF IEC61937 payloading (2.25 KB, patch)
2014-09-27 05:10 UTC, Arun Raghavan
committed Details | Review
audio: correct condition for MPEG case. (1.02 KB, patch)
2014-09-27 05:10 UTC, Arun Raghavan
committed Details | Review

Description Anuj 2014-09-17 12:46:33 UTC
Created attachment 286369 [details] [review]
audio: correct condition for MPEG case.

gst-libs/gst/audio: 
In gstaudioiec61937.c for frames=2304 I think layer should be equals to 2 or 3.
correct me if I am wrong. Please review
Thanks
Comment 1 Luis de Bethencourt 2014-09-23 16:25:33 UTC
Hi Anuj,

Could you please provide me more information of why it should be layer 2 instead of layer 1?
Comment 2 Tim-Philipp Müller 2014-09-23 16:44:10 UTC
Because the condition has already been check for layer == 1 in the previous if. So something has to change, but it's not clear what and to which value.
Comment 3 Sebastian Dröge (slomo) 2014-09-24 11:16:00 UTC
Yeah, it's obviously wrong but not clear what it should be. Someone needs to check the spec.
Comment 4 Luis de Bethencourt 2014-09-24 12:28:16 UTC
Yes, I was asking Anuj if he could provide a link to the spec to show why his patch is correct.
Comment 5 Anuj 2014-09-24 13:19:38 UTC
I found this equation for calculating frame size:
FrameLengthInBytes = 144 * BitRate / SampleRate + Padding.

http://www.datavoyage.com/mpgscript/mpeghdr.htm
 
But I am not sure about this doc is the latest one or some modifications have been made into MPEG.
Comment 6 Luis de Bethencourt 2014-09-24 13:29:54 UTC
I don't find any newer doc. It looks like a good fix to me.

Maybe the frame number can be tweaked in the future. But currently we have two else if cases that have the same condition, so the second one is never going to happen.

If Tim and Sebastian are OK with this I will merge the patch.
Comment 7 Sebastian Dröge (slomo) 2014-09-24 13:34:13 UTC
Note that this is iec61937, so looking at the information for MP1/2/3 does not necessarily help. Also 2304 never appeared anywhere on that website and I also never saw it used in combination with MP1/2/3.

So we need to check where this number comes from in iec61937
Comment 8 Arun Raghavan 2014-09-24 14:46:36 UTC
Created attachment 286986 [details] [review]
audio: Fixes for MPEG-2 LSF IEC61937 payloading

The low sample frequency case for MPEG-2 is <=12kHz (the 32kHz number
applies to MPEG-1). In addition, there was a copy-pasto for the layer 1
vs. layer 2 case.

Also adds some documentation of what the fallthrough case is supposed to
cover.
Comment 9 Arun Raghavan 2014-09-24 14:49:15 UTC
The layer fix was correct, but there was another bug fixed by the attached patch.

Would be nice if someone could also double-check against the spec to make sure I got it right this time. Else I can push this.
Comment 10 Arun Raghavan 2014-09-24 14:52:44 UTC
Comment on attachment 286986 [details] [review]
audio: Fixes for MPEG-2 LSF IEC61937 payloading

Looks like I missed a bunch of related fixes with the 32->12kHz changes. Updated fix coming up.
Comment 11 Arun Raghavan 2014-09-24 15:10:39 UTC
Comment on attachment 286369 [details] [review]
audio: correct condition for MPEG case.

Unobsoleting Anuj's patch to keep credit, and adding a couple of patches on top.
Comment 12 Arun Raghavan 2014-09-24 15:11:57 UTC
Created attachment 286987 [details] [review]
audio: Fixes for MPEG-2 LSF IEC61937 payloading

The low sample frequency case for MPEG-2 is <=12kHz (the 32kHz number
applies to MPEG-1).
Comment 13 Arun Raghavan 2014-09-24 15:12:05 UTC
Created attachment 286988 [details] [review]
audio: Trivial comment for unhandled MPEG-2 payloading case
Comment 14 Arun Raghavan 2014-09-24 15:13:51 UTC
Just as context for the last trivial comment - the spec mentions a version of the MPEG-2 frame with a base frame and extension frame. I don't have IEC 13818-3 to figure out what that is, and don't see any references in search results, so it's a FIXME for now.
Comment 15 Arun Raghavan 2014-09-27 05:10:29 UTC
The following fixes have been pushed:
324ebd1 audio: Trivial comment for unhandled MPEG-2 payloading case
2965b79 audio: Fixes for MPEG-2 LSF IEC61937 payloading
798ff6e audio: correct condition for MPEG case.
Comment 16 Arun Raghavan 2014-09-27 05:10:37 UTC
Created attachment 287223 [details] [review]
audio: Trivial comment for unhandled MPEG-2 payloading case

The spec mentions a version of the MPEG-2 frame with a base frame and
extension frame. I don't have IEC 13818-3 to figure out what that is,
and don't see any references in search results, so it's a FIXME for now.
Comment 17 Arun Raghavan 2014-09-27 05:10:47 UTC
Created attachment 287224 [details] [review]
audio: Fixes for MPEG-2 LSF IEC61937 payloading

The low sample frequency case for MPEG-2 is <=12kHz (the 32kHz number
applies to MPEG-1).
Comment 18 Arun Raghavan 2014-09-27 05:10:59 UTC
Created attachment 287225 [details] [review]
audio: correct condition for MPEG case.

Signed-off-by: Anuj Jaiswal <anuj.jaiswal@samsung.com>