Commit abc4ec99 authored by Markus Handell's avatar Markus Handell Committed by Commit Bot

WebmMuxer: fix bug shadowed by broken unit test.

While cleaning up to act on actually observed buffers in the WebM stream parser stream, I discovered that this test expectation isn't working:

https://source.chromium.org/chromium/chromium/src/+/master:media/muxers/webm_muxer_unittest.cc;l=645-658?q=webm_muxer_unittest.cc&ss=chromium%2Fchromium%2Fsrc.

After acting on actually passed buffers, it was found that the test fails. The reason is that in https://source.chromium.org/chromium/chromium/src/+/master:media/muxers/webm_muxer.h;l=155-157;bpv=1;bpt=1, last_xxx_ attributes are unset on first incoming buffers, leading the code to believe it's receiving non-monotonically increasing buffer timestamps.

Bug: chromium:1124735
Change-Id: Icf093fb94eef637ab17b8d38edd066313b5f7b48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390634
Commit-Queue: Markus Handell <handellm@google.com>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804636}
parent 1ccf4c97
...@@ -222,6 +222,7 @@ bool WebmMuxer::OnEncodedVideo(const VideoParameters& params, ...@@ -222,6 +222,7 @@ bool WebmMuxer::OnEncodedVideo(const VideoParameters& params,
if (first_frame_timestamp_video_.is_null()) { if (first_frame_timestamp_video_.is_null()) {
// Compensate for time in pause spent before the first frame. // Compensate for time in pause spent before the first frame.
first_frame_timestamp_video_ = timestamp - total_time_in_pause_; first_frame_timestamp_video_ = timestamp - total_time_in_pause_;
last_frame_timestamp_video_ = first_frame_timestamp_video_;
} }
} }
...@@ -250,6 +251,7 @@ bool WebmMuxer::OnEncodedAudio(const media::AudioParameters& params, ...@@ -250,6 +251,7 @@ bool WebmMuxer::OnEncodedAudio(const media::AudioParameters& params,
if (first_frame_timestamp_audio_.is_null()) { if (first_frame_timestamp_audio_.is_null()) {
// Compensate for time in pause spent before the first frame. // Compensate for time in pause spent before the first frame.
first_frame_timestamp_audio_ = timestamp - total_time_in_pause_; first_frame_timestamp_audio_ = timestamp - total_time_in_pause_;
last_frame_timestamp_audio_ = first_frame_timestamp_audio_;
} }
} }
...@@ -437,7 +439,6 @@ bool WebmMuxer::FlushNextFrame() { ...@@ -437,7 +439,6 @@ bool WebmMuxer::FlushNextFrame() {
force_one_libwebm_error_ = false; force_one_libwebm_error_ = false;
return false; return false;
} }
DCHECK(frame.data.data()); DCHECK(frame.data.data());
bool result = bool result =
frame.alpha_data.empty() frame.alpha_data.empty()
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment