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

Unified Diff: media/base/media_posix.cc

Issue 113598: Use av_rescale_q() for converting FFmpeg timestamps to base::TimeDelta. (Closed)
Patch Set: Tweaksd Created 11 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
« no previous file with comments | « no previous file | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_posix.cc
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
index 4bddf6d593ca9d1de3797eb5a26bef7d763aaa31..94c1a896024da4c805fc5e3b4c08d26cae715ed9 100644
--- a/media/base/media_posix.cc
+++ b/media/base/media_posix.cc
@@ -122,6 +122,11 @@ void av_free(void* ptr) {
return av_free_ptr(ptr);
}
+int64_t (*av_rescale_q_ptr)(int64_t a, AVRational bq, AVRational cq) = NULL;
+int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) {
+ return av_rescale_q_ptr(a, bq, cq);
+}
+
} // extern "C"
@@ -240,6 +245,9 @@ bool InitializeMediaLibrary(const FilePath& module_dir) {
av_free_ptr =
reinterpret_cast<void (*)(void*)>(
dlsym(libs[FILE_LIBAVUTIL], "av_free"));
+ av_rescale_q_ptr =
+ reinterpret_cast<int64_t (*)(int64_t, AVRational, AVRational)>(
+ dlsym(libs[FILE_LIBAVUTIL], "av_rescale_q"));
// Check that all the symbols were loaded correctly before returning true.
if (av_get_bits_per_sample_format_ptr &&
@@ -259,7 +267,8 @@ bool InitializeMediaLibrary(const FilePath& module_dir) {
av_register_protocol_ptr &&
av_malloc_ptr &&
- av_free_ptr) {
+ av_free_ptr &&
+ av_rescale_q_ptr) {
return true;
}
« no previous file with comments | « no previous file | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698