diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-03 02:08:23 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-03 02:08:23 +0000 |
commit | a6c2d93ff440b7693f35f7fc576f5818c638e6da (patch) | |
tree | 470f103d972769bfb9d4382019ae841a77e0b247 /media/formats | |
parent | ec37323959db7c1d7b388dc08b1d318ddb46ec06 (diff) | |
download | chromium_src-a6c2d93ff440b7693f35f7fc576f5818c638e6da.zip chromium_src-a6c2d93ff440b7693f35f7fc576f5818c638e6da.tar.gz chromium_src-a6c2d93ff440b7693f35f7fc576f5818c638e6da.tar.bz2 |
Support start trimming post-decoding. Use it with FFmpegDemuxer.
FFmpeg has packet side data indicating how many frames should be
trimmed after decoding, we should use it to improve playback of
mp3 and aac audio via <audio> tag.
Specifically:
- AudioBuffer:TrimRange(start,end) is now supported.
- DecoderBuffer:discard_padding() is now a pair of (front, back)
which indicates how much to trim off the front and rear of the
data corresponding to the encoded buffer.
- AudioDiscardHelper has been updated to implement this trimming.
- FFmpegDemuxer inserts FFmpeg's skip_samples into DecoderBuffer.
This change paves the way for MediaSource to use this feature to
implement gapless playback support.
BUG=360961
TEST=new unittests!
NOTRY=true
Review URL: https://codereview.chromium.org/251893002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/formats')
-rw-r--r-- | media/formats/webm/webm_cluster_parser.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/media/formats/webm/webm_cluster_parser.cc b/media/formats/webm/webm_cluster_parser.cc index 3816fdb..172eafa 100644 --- a/media/formats/webm/webm_cluster_parser.cc +++ b/media/formats/webm/webm_cluster_parser.cc @@ -416,8 +416,9 @@ bool WebMClusterParser::OnBlock(bool is_simple_block, int track_num, } if (discard_padding != 0) { - buffer->set_discard_padding(base::TimeDelta::FromMicroseconds( - discard_padding / 1000)); + buffer->set_discard_padding(std::make_pair( + base::TimeDelta(), + base::TimeDelta::FromMicroseconds(discard_padding / 1000))); } return track->AddBuffer(buffer); |