Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Issue 1868983004: Fixing AudioBuffer params and channel layout bugs (Closed)

Created:
4 years, 8 months ago by tguilbert
Modified:
4 years, 8 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixing AudioBuffer params and channel layout bugs Work for AAC implicit signaling introduced the possiblity for audio rendering configs to change to change midstream. Checking for channel layout changes caused a regression and caused 6 channel audio playback to fail. Clusterfuzz also detected some heap buffer overflow issues, when the decoded audio buffers we receive have a different channel layout or sample rate than the ones we expect. This change allows FfmpegAudioDecoder to ignore channel layout changes on non AAC codec. It also checks that decoded AudioBuffer sample rate and channel count match the expected parameters before adding them to the splicer queue, in AudioRendererImpl. BUG=599625, 599846, 600538 TEST=manual tests on an ASAN build, with ffmpeg_regression_test to follow REVIEW=dalecurtis Committed: https://crrev.com/43eed5f900264ff88be25806c883dab2011260fa Cr-Commit-Position: refs/heads/master@{#385922}

Patch Set 1 #

Patch Set 2 : Fixing typos #

Total comments: 16

Patch Set 3 : Addressing comments #

Patch Set 4 : Addressing last comment #

Patch Set 5 : cl format #

Patch Set 6 : Returning after pipeline error #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -4 lines) Patch
M media/filters/ffmpeg_audio_decoder.cc View 1 2 3 4 2 chunks +13 lines, -4 lines 2 comments Download
M media/renderers/audio_renderer_impl.cc View 1 2 3 4 5 1 chunk +20 lines, -0 lines 4 comments Download

Messages

Total messages: 25 (11 generated)
tguilbert
4 years, 8 months ago (2016-04-07 19:14:07 UTC) #2
DaleCurtis
https://codereview.chromium.org/1868983004/diff/20001/media/filters/ffmpeg_audio_decoder.cc File media/filters/ffmpeg_audio_decoder.cc (right): https://codereview.chromium.org/1868983004/diff/20001/media/filters/ffmpeg_audio_decoder.cc#newcode303 media/filters/ffmpeg_audio_decoder.cc:303: bool config_is_stale = Naming style in chrome is typically ...
4 years, 8 months ago (2016-04-07 20:05:05 UTC) #3
tguilbert
https://codereview.chromium.org/1868983004/diff/20001/media/filters/ffmpeg_audio_decoder.cc File media/filters/ffmpeg_audio_decoder.cc (right): https://codereview.chromium.org/1868983004/diff/20001/media/filters/ffmpeg_audio_decoder.cc#newcode303 media/filters/ffmpeg_audio_decoder.cc:303: bool config_is_stale = On 2016/04/07 20:05:04, DaleCurtis wrote: > ...
4 years, 8 months ago (2016-04-07 21:08:50 UTC) #4
DaleCurtis
lgtm % offline discussion to only call resettimestampstate on sample rate changes.
4 years, 8 months ago (2016-04-07 21:13:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1868983004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1868983004/60001
4 years, 8 months ago (2016-04-07 21:18:59 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/166023)
4 years, 8 months ago (2016-04-07 21:34:33 UTC) #10
DaleCurtis
Patch failed since you skipped git cl format.
4 years, 8 months ago (2016-04-07 21:36:14 UTC) #11
tguilbert
4 years, 8 months ago (2016-04-07 21:44:57 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1868983004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1868983004/80001
4 years, 8 months ago (2016-04-07 21:45:55 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1868983004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1868983004/100001
4 years, 8 months ago (2016-04-07 22:02:13 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 8 months ago (2016-04-07 23:35:00 UTC) #20
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/43eed5f900264ff88be25806c883dab2011260fa Cr-Commit-Position: refs/heads/master@{#385922}
4 years, 8 months ago (2016-04-07 23:37:31 UTC) #22
chcunningham
Thanks for saving implicit signalling from revert! Some questions for you below https://codereview.chromium.org/1868983004/diff/100001/media/filters/ffmpeg_audio_decoder.cc File media/filters/ffmpeg_audio_decoder.cc ...
4 years, 8 months ago (2016-04-19 00:28:57 UTC) #24
tguilbert
4 years, 8 months ago (2016-04-19 18:17:57 UTC) #25
Message was sent while issue was closed.
https://codereview.chromium.org/1868983004/diff/100001/media/filters/ffmpeg_a...
File media/filters/ffmpeg_audio_decoder.cc (right):

https://codereview.chromium.org/1868983004/diff/100001/media/filters/ffmpeg_a...
media/filters/ffmpeg_audio_decoder.cc:310: // allow channel layout changes for
the moment. See if ffmpeg is fixable.
On 2016/04/19 00:28:56, chcunningham wrote:
> Just to confirm my understanding, we initially have CHANNEL_LAYOUT_5_1, but
then
> a buffer comes in with CHANNEL_LAYOUT_5_1_BACK, and we believe this is a bug
in
> FFmpeg? I don't know the .wav format (MPEG PS?) well... I can't say whether a
> channel layout should be possible. 
> 
> Can you share the .wav files from the bug with me? I'm not able to download
from
> pantheon for some reason. I'm wondering which of these layouts is expected (if
> not both). Also wondering how far reaching this bug is. 

I do not know if this is a bug per-say in Ffmpeg. We seemed to have never taken
this as a guarantee before. We don't set the layout [0] and it is potentially
overwritten from what I understand [1].

This failure did not happen mid stream, but failed as soon as the file started
playing.

0:
https://code.google.com/p/chromium/codesearch#chromium/src/media/ffmpeg/ffmpe...
1:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/ffmpeg...

https://codereview.chromium.org/1868983004/diff/100001/media/renderers/audio_...
File media/renderers/audio_renderer_impl.cc (right):

https://codereview.chromium.org/1868983004/diff/100001/media/renderers/audio_...
media/renderers/audio_renderer_impl.cc:538: // TODO(chcunningham, tguilbert):
Figure out if we want to support implicit
On 2016/04/19 00:28:56, chcunningham wrote:
> Implicit config changes for AAC actually work with today's src= code because
> ffmpeg figures figures out the implicit AAC profile when it first opens it up.
> We have src= tests for the various aac files here [0]. I'm not aware of other
> containers that do implicit signalling nor am I aware of anyone asking for
> additional src= support. Decode error LGTM for now :)
> 
> 
> 0:
>
https://code.google.com/p/chromium/codesearch#chromium/src/media/test/pipelin...

Discussed offline. Currently, the media used to test signaling doesn't work
properly on src= playback.

https://codereview.chromium.org/1868983004/diff/100001/media/renderers/audio_...
media/renderers/audio_renderer_impl.cc:558: if (!splicer_->AddInput(buffer)) {
On 2016/04/19 00:28:56, chcunningham wrote:
> IIUC, prior to adding the decode error above, we were doing a buffer overflow
in
> AudioBuffer::ReadFrames. I notice that method has a few DCHECKS [0] for this
> scenario... What do you guys think about making them CHECKS instead? 
> 
> 
> 0:
>
https://code.google.com/p/chromium/codesearch#chromium/src/media/base/audio_b...

SGTM, but please get a second opinion :)

Powered by Google App Engine
This is Rietveld 408576698