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

Issue 113619: Use av_rescale_q() for converting FFmpeg timestamps to base::TimeDelta (second attempt). (Closed)

Created:
11 years, 7 months ago by scherkus (not reviewing)
Modified:
9 years, 7 months ago
Reviewers:
awong
CC:
chromium-reviews_googlegroups.com, Nicolas Sylvain
Visibility:
Public.

Description

Use av_rescale_q() for converting FFmpeg timestamps to base::TimeDelta (second attempt). Previously we were using integer math to convert to microseconds, but depending on the frame rate and packet size we could introduce enough error that could accumulate and introduce audio/video synchronization drift. av_rescale_q() is a simple function but is designed to minimize error as much as possible. Second attempt since I forgot to manually resolve av_rescale_q() for unittests.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -18 lines) Patch
M media/base/media_posix.cc View 3 chunks +10 lines, -1 line 0 comments Download
M media/filters/ffmpeg_audio_decoder.h View 1 chunk +4 lines, -0 lines 0 comments Download
M media/filters/ffmpeg_audio_decoder.cc View 2 chunks +27 lines, -3 lines 0 comments Download
M media/filters/ffmpeg_demuxer.h View 2 chunks +5 lines, -5 lines 0 comments Download
M media/filters/ffmpeg_demuxer.cc View 4 chunks +11 lines, -9 lines 0 comments Download
M media/filters/ffmpeg_demuxer_unittest.cc View 1 chunk +6 lines, -0 lines 2 comments Download
M third_party/ffmpeg/avutil-50.def View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
scherkus (not reviewing)
Windows was resolving my delay loaded symbols hence I didn't catch the break locally. Try ...
11 years, 7 months ago (2009-05-20 06:08:02 UTC) #1
awong
lgtm http://codereview.chromium.org/113619/diff/1/7 File media/filters/ffmpeg_demuxer_unittest.cc (right): http://codereview.chromium.org/113619/diff/1/7#newcode137 Line 137: int64 av_rescale_q(int64 a, AVRational bq, AVRational cq) ...
11 years, 7 months ago (2009-05-20 18:17:42 UTC) #2
scherkus (not reviewing)
11 years, 7 months ago (2009-05-20 18:21:27 UTC) #3
http://codereview.chromium.org/113619/diff/1/7
File media/filters/ffmpeg_demuxer_unittest.cc (right):

http://codereview.chromium.org/113619/diff/1/7#newcode137
Line 137: int64 av_rescale_q(int64 a, AVRational bq, AVRational cq) {
On 2009/05/20 18:17:42, awong wrote:
> Hah...cute.  We do need a way to better mock these things. :-/

You should see the actual implementation.  It's an explosion of shifts and bit
mask operators!!

This implementation will easily overflow hehe

Powered by Google App Engine
This is Rietveld 408576698