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

Unified Diff: media/filters/legacy_frame_processor.cc

Issue 276573002: Add gapless playback support for AAC playback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with tests! Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/legacy_frame_processor.cc
diff --git a/media/filters/legacy_frame_processor.cc b/media/filters/legacy_frame_processor.cc
index 71c280183f2d2f74026d89dae8074f23737c5c44..201f2f3f6ab2ef7c14d70d02b4d144d4d83241c5 100644
--- a/media/filters/legacy_frame_processor.cc
+++ b/media/filters/legacy_frame_processor.cc
@@ -213,6 +213,12 @@ void LegacyFrameProcessor::FilterWithAppendWindow(
buffer->SetDecodeTimestamp(append_window_start);
buffer->set_duration(frame_end_timestamp - append_window_start);
+ // If this isn't the first buffer discarded by the append window, pull
+ // in the buffer immediately preceding this one for preroll. This
+ // ensures that the partially trimmed buffer can be correctly decoded.
+ if (itr != buffers.begin())
acolwell GONE FROM CHROMIUM 2014/05/16 17:01:11 This looks like it would only work if both buffers
DaleCurtis 2014/05/16 17:48:59 Hmm, since buffers outside the append window are l
acolwell GONE FROM CHROMIUM 2014/05/16 20:26:05 If that is what is necessary. Appending 1 byte at
DaleCurtis 2014/05/22 23:58:57 Done.
+ buffer->SetPrerollBuffer(*(itr - 1));
+
// TODO(dalecurtis): This could also be done with |append_window_end|,
// but is not necessary since splice frames cover the overlap there.
} else {

Powered by Google App Engine
This is Rietveld 408576698