Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the AudioDecoder class #81

Merged
merged 2 commits into from
Jul 10, 2020
Merged

Conversation

adlarkin
Copy link
Contributor

@adlarkin adlarkin commented Jul 8, 2020

I've updated the unit tests for the AudioDecoder class so that they compile and pass.

I also added a check in AudioDecoder::SampleRate to ensure that a null pointer is not de-referenced in case users call AudioDecoder::SampleRate before calling AudioDecoder::SetFile.

One question: In the case where users call AudioDecoder::SampleRate before calling AudioDecoder::SetFile, what should AudioDecoder::SampleRate return? I made AudioDecoder::SampleRate return -1 in this case, because I figured that a negative sample rate implies that the decoder's current state is invalid. I anyone thinks there is a better value to return (for example, 0), let me know, and I will update AudioDecoder::SampleRate accordingly.

@adlarkin adlarkin requested review from nkoenig, scpeters and iche033 July 8, 2020 21:13
@adlarkin adlarkin requested a review from mjcarroll as a code owner July 8, 2020 21:13
@github-actions github-actions bot added 🏰 citadel Ignition Citadel 📜 blueprint Ignition Blueprint 🔮 dome Ignition Dome labels Jul 8, 2020
@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #81 into ign-common3 will increase coverage by 0.21%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-common3      #81      +/-   ##
===============================================
+ Coverage        73.72%   73.94%   +0.21%     
===============================================
  Files               68       69       +1     
  Lines             9287     9390     +103     
===============================================
+ Hits              6847     6943      +96     
- Misses            2440     2447       +7     
Impacted Files Coverage Δ
av/src/AudioDecoder.cc 85.43% <100.00%> (ø)
av/src/Util.cc 100.00% <0.00%> (+10.34%) ⬆️
av/src/ffmpeg_inc.cc 25.00% <0.00%> (+25.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6f7d2d...0038102. Read the comment docs.

@mjcarroll
Copy link
Contributor

Rebase on ign-common3 and signoff for DCO please.

@adlarkin adlarkin force-pushed the audioDecoder_fix_adlarkin branch from 9881f02 to a578b49 Compare July 8, 2020 21:41
@scpeters
Copy link
Member

scpeters commented Jul 9, 2020

One question: In the case where users call AudioDecoder::SampleRate before calling AudioDecoder::SetFile, what should AudioDecoder::SampleRate return? I made AudioDecoder::SampleRate return -1 in this case, because I figured that a negative sample rate implies that the decoder's current state is invalid. I anyone thinks there is a better value to return (for example, 0), let me know, and I will update AudioDecoder::SampleRate accordingly.

-1 sounds reasonable to me, and you documented it in the header file, so it looks fine to me

@iche033
Copy link
Contributor

iche033 commented Jul 9, 2020

changes look good to me. Just need to rebase for abi-checker build to pass

adlarkin added 2 commits July 9, 2020 14:37
Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
@adlarkin adlarkin force-pushed the audioDecoder_fix_adlarkin branch from a578b49 to 0038102 Compare July 9, 2020 18:40
@mjcarroll
Copy link
Contributor

@scpeters and @iche033 I'm trying to help Ashton understand the output of the ABI report here:
https://build.osrfoundation.org/job/ignition_common-abichecker-any_to_any-ubuntu_auto-amd64/251/API_5fABI_20report/

Based on the changes in the PR, I wouldn't anticipate any API or ABI problems, because nothing along those lines has changed.

As far as I can tell the checker believes that essential the same symbol (mod template specialization) is being removed and added. What is interesting is that this cc file wasn't part of the build until this pull request.

If I look at my local copies of libignition-common3, that symbol doesn't exist:

$ nm -D /usr/lib/x86_64-linux-gnu/libignition-common3-av.so.3 | grep AudioDecoder
$ nm -D /usr/lib/x86_64-linux-gnu/libignition-common3.so.3 | grep AudioDecoder

@scpeters
Copy link
Member

scpeters commented Jul 9, 2020

I'm trying to help Ashton understand the output of the ABI report here:
https://build.osrfoundation.org/job/ignition_common-abichecker-any_to_any-ubuntu_auto-amd64/251/API_5fABI_20report/

that looks like a false positive, which I've seen before: gazebo-tooling/release-tools#120

no code in that header file is changed, so I would just ignore it. an administrator should override the blocked merge in this case

@iche033
Copy link
Contributor

iche033 commented Jul 10, 2020

oh I didn't know about the abi-checker bug. Not sure if it's an issue with the abi-checker when the base version contains only the header files and the .cc files were not being built.

@adlarkin
Copy link
Contributor Author

Thanks for following up on this, @scpeters and @mjcarroll. Is everything okay then, or are there any other changes I need to make?

@mjcarroll mjcarroll merged commit 851aae0 into ign-common3 Jul 10, 2020
@mjcarroll mjcarroll deleted the audioDecoder_fix_adlarkin branch July 10, 2020 14:43
mjcarroll pushed a commit that referenced this pull request Oct 14, 2020
* fixed existing AudioDecoder unit tests

Signed-off-by: Ashton Larkin <ashton@openrobotics.org>

* handled possible seg fault by using AudioDecoder without calling SetFile

Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
mjcarroll pushed a commit that referenced this pull request Oct 19, 2020
* fixed existing AudioDecoder unit tests

Signed-off-by: Ashton Larkin <ashton@openrobotics.org>

* handled possible seg fault by using AudioDecoder without calling SetFile

Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 blueprint Ignition Blueprint 🏰 citadel Ignition Citadel 🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants