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

Issue 1260193005: Fix incorrect opus seek preroll and flaky pre-skip removal. (Closed)

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

Description

Fix incorrect opus seek preroll and flaky pre-skip removal. Opus seek preroll was being treated as decoder delay when it really just means that for seeking to a time T, we need to decode packets starting from time "T - seek_preroll" and throw them away. Instead we were discarding time [T, T+seek_preroll] and shifting the timestamps backwards to accommodate the deletion. For pre-skip, we would assume the first packet seen by the decoder was the timestamp for which pre-skip should be applied. However, this is incorrect and pre-skip should always be dropped because timestamp zero represents the beginning of the pre-skip, which causes all future timestamps to be displaced by pre-skip duration. This patch fixes pre-skip and seek preroll for src= and pre-skip only for MSE. ChunkDemuxer needs to be modified to support preroll. src= is fixed by expanding the hacks in place for negative ogg timestamps to handle negative timestamps from ffmpeg in a more general manner. This patch also adds test cases for the seeking cases (one of which MSE can pass because the test clip has a codec delay > seek preroll). Since these tests would otherwise take some time to run, this also adds support for clockless hashed pipeline integration tests. BUG=509894 TEST=OpusAudioDecoder and OPUS PipelineIntegration tests pass w/o expectations modification. New trimming pipeline tests. New FFmpegDemuxerTest to verify audio/video timestamp sync. Committed: https://crrev.com/aa958fd3a80afdfdc2f747a819a1c67605c637e6 Cr-Commit-Position: refs/heads/master@{#342274}

Patch Set 1 : Remove typo. #

Patch Set 2 : Add workaround for MSE. #

Patch Set 3 : Fix seeking. #

Patch Set 4 : Add test cases. #

Total comments: 20

Patch Set 5 : Fix comments. #

Patch Set 6 : Don't use duration / 2 since MSE and FFmpeg defer. #

Patch Set 7 : Simplify, add tests. #

Patch Set 8 : Fix remainder, add test. #

Patch Set 9 : Simplify #

Total comments: 43

Patch Set 10 : Comments. #

Total comments: 8

Patch Set 11 : Comments. #

Patch Set 12 : Rebase. Comments. #

Patch Set 13 : Fix mojo renderer. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -99 lines) Patch
M media/audio/clockless_audio_sink.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -0 lines 0 comments Download
M media/audio/clockless_audio_sink.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +30 lines, -8 lines 0 comments Download
M media/base/audio_discard_helper.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -5 lines 0 comments Download
M media/filters/ffmpeg_audio_decoder.cc View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -5 lines 0 comments Download
M media/filters/ffmpeg_demuxer.h View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -7 lines 0 comments Download
M media/filters/ffmpeg_demuxer.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +60 lines, -36 lines 0 comments Download
M media/filters/ffmpeg_demuxer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +75 lines, -0 lines 0 comments Download
M media/filters/opus_audio_decoder.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -5 lines 0 comments Download
M media/filters/opus_audio_decoder.cc View 1 2 3 4 5 6 7 8 5 chunks +7 lines, -19 lines 0 comments Download
A media/test/data/opus-trimming-test.ogg View 1 2 3 Binary file 0 comments Download
A media/test/data/opus-trimming-test.webm View 1 2 3 Binary file 0 comments Download
A media/test/data/opus-trimming-video-test.webm View 1 2 3 4 5 6 Binary file 0 comments Download
M media/test/pipeline_integration_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +102 lines, -0 lines 0 comments Download
M media/test/pipeline_integration_test_base.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -3 lines 0 comments Download
M media/test/pipeline_integration_test_base.cc View 1 2 3 4 4 chunks +21 lines, -11 lines 0 comments Download

Messages

Total messages: 33 (9 generated)
DaleCurtis
5 years, 4 months ago (2015-07-28 23:34:20 UTC) #3
DaleCurtis
Actually, after posting this I realized there was a four line hack which would keep ...
5 years, 4 months ago (2015-07-28 23:45:52 UTC) #4
wolenetz
The discussion in the bug (comments #18,20-21) is confusing me w.r.t. this CL: is FFmpeg ...
5 years, 4 months ago (2015-07-29 00:17:19 UTC) #5
DaleCurtis
Hmm, after investigation all that code can be deleted, it was not correct. FFmpeg is ...
5 years, 4 months ago (2015-07-29 01:27:15 UTC) #6
wolenetz
I like the new tests :) How did the local-only attempt to hack seek_preroll into ...
5 years, 4 months ago (2015-07-29 21:57:27 UTC) #7
DaleCurtis
I've confirmed that at least for a seek within the pre-skip section adding the 80ms ...
5 years, 4 months ago (2015-07-30 01:28:14 UTC) #8
DaleCurtis
Okay disregard my last comment about further issues with MSE, the only issue is the ...
5 years, 4 months ago (2015-07-30 19:04:58 UTC) #9
DaleCurtis
Turns out new code wasn't necessary in ffmpeg demxuer, we already had code in place ...
5 years, 4 months ago (2015-07-30 23:24:44 UTC) #10
DaleCurtis
Need to find another seek test clip for mse/src= since the one I added has ...
5 years, 4 months ago (2015-07-31 02:41:00 UTC) #12
chcunningham
Mostly I'm just asking questions for my own understanding :) https://codereview.chromium.org/1260193005/diff/190001/media/base/audio_discard_helper.cc File media/base/audio_discard_helper.cc (right): https://codereview.chromium.org/1260193005/diff/190001/media/base/audio_discard_helper.cc#newcode108 ...
5 years, 4 months ago (2015-07-31 19:48:45 UTC) #13
DaleCurtis
https://codereview.chromium.org/1260193005/diff/190001/media/base/audio_discard_helper.cc File media/base/audio_discard_helper.cc (right): https://codereview.chromium.org/1260193005/diff/190001/media/base/audio_discard_helper.cc#newcode108 media/base/audio_discard_helper.cc:108: // consumes the entire buffer. On 2015/07/31 19:48:44, chcunningham ...
5 years, 4 months ago (2015-08-03 22:49:53 UTC) #14
chcunningham
Did you learn any more about the state of MSE pre-roll? Is it still just ...
5 years, 4 months ago (2015-08-04 20:38:09 UTC) #15
wolenetz
My apologies for slow review on this. I'll get to my next iteration on this ...
5 years, 4 months ago (2015-08-04 21:32:38 UTC) #16
DaleCurtis
MSE preroll is not doing the right thing, but it luckily works if pre-skip > ...
5 years, 4 months ago (2015-08-04 21:38:34 UTC) #17
chcunningham
LGTM. Thanks for all the info :D.
5 years, 4 months ago (2015-08-04 23:11:41 UTC) #18
wolenetz
lgtm % 2 nits in pipeline_integration_test.cc: https://codereview.chromium.org/1260193005/diff/70001/media/audio/clockless_audio_sink.cc File media/audio/clockless_audio_sink.cc (right): https://codereview.chromium.org/1260193005/diff/70001/media/audio/clockless_audio_sink.cc#newcode43 media/audio/clockless_audio_sink.cc:43: return audio_hash_->ToString(); On ...
5 years, 4 months ago (2015-08-06 22:21:27 UTC) #19
DaleCurtis
https://codereview.chromium.org/1260193005/diff/190001/media/filters/ffmpeg_demuxer.cc File media/filters/ffmpeg_demuxer.cc (right): https://codereview.chromium.org/1260193005/diff/190001/media/filters/ffmpeg_demuxer.cc#newcode297 media/filters/ffmpeg_demuxer.cc:297: // If this is an OGG file with negative ...
5 years, 4 months ago (2015-08-06 23:45:27 UTC) #20
DaleCurtis
Thanks for review!
5 years, 4 months ago (2015-08-06 23:45:37 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1260193005/250001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1260193005/250001
5 years, 4 months ago (2015-08-06 23:47:05 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1260193005/270001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1260193005/270001
5 years, 4 months ago (2015-08-07 00:19:12 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/90176)
5 years, 4 months ago (2015-08-07 02:10:13 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1260193005/270001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1260193005/270001
5 years, 4 months ago (2015-08-07 02:19:23 UTC) #31
commit-bot: I haz the power
Committed patchset #13 (id:270001)
5 years, 4 months ago (2015-08-07 02:59:10 UTC) #32
commit-bot: I haz the power
5 years, 4 months ago (2015-08-07 03:00:08 UTC) #33
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/aa958fd3a80afdfdc2f747a819a1c67605c637e6
Cr-Commit-Position: refs/heads/master@{#342274}

Powered by Google App Engine
This is Rietveld 408576698