|
From: Lasse Kärkkäi. <tr...@us...> - 2012-03-16 23:25:42
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Mar 17 01:14:02 2012 +0200
Fix a compile error due to missing av_rescale_q by removing some unnecessary per-stream seeking logic.
---
game/ffmpeg.cc | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 87efcfa..1f5d5b2 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -125,13 +125,7 @@ void FFmpeg::seek_internal() {
audioQueue.reset();
int flags = 0;
if (m_seekTarget < position()) flags |= AVSEEK_FLAG_BACKWARD;
- int stream = -1;
- if (decodeVideo) stream = videoStream;
- if (decodeAudio) stream = audioStream;
- int64_t target = m_seekTarget * AV_TIME_BASE;
- const AVRational time_base_q = { 1, AV_TIME_BASE }; // AV_TIME_BASE_Q is the same thing with C99 struct literal (not supported by MSVC)
- if (stream != -1) target = av_rescale_q(target, time_base_q, pFormatCtx->streams[stream]->time_base);
- av_seek_frame(pFormatCtx, stream, target, flags);
+ av_seek_frame(pFormatCtx, -1, m_seekTarget * AV_TIME_BASE, flags);
m_seekTarget = getNaN(); // Signal that seeking is done
}
|