summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-10-16 16:30:11 +0100
committerCarl Hetherington <cth@carlh.net>2014-10-16 16:30:11 +0100
commit0b6c6de07f9a3aa28c2e8ca8ef30340e3fa1bfc6 (patch)
tree075a7a604bbd4e072ec1b07481d4eb82ed7ffd34 /src/lib/ffmpeg_decoder.cc
parent42a122334d594b824c666e5263168386a76801cc (diff)
parent016a98b18d01276a1e603885a25785e7389f14d9 (diff)
Merge branch 'master' into 12bit
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 07f988e2b..d40b798ba 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -23,7 +23,6 @@
#include <stdexcept>
#include <vector>
-#include <sstream>
#include <iomanip>
#include <iostream>
#include <stdint.h>
@@ -53,7 +52,6 @@ extern "C" {
using std::cout;
using std::string;
using std::vector;
-using std::stringstream;
using std::list;
using std::min;
using std::pair;
@@ -334,7 +332,7 @@ FFmpegDecoder::seek (VideoContent::Frame frame, bool accurate)
}
/* Initial seek time in the stream's timebase */
- int64_t const initial_vt = ((initial / _ffmpeg_content->video_frame_rate()) - _pts_offset) / time_base;
+ int64_t const initial_vt = ((initial / _ffmpeg_content->original_video_frame_rate()) - _pts_offset) / time_base;
av_seek_frame (_format_context, _video_stream, initial_vt, AVSEEK_FLAG_BACKWARD);
@@ -375,7 +373,7 @@ FFmpegDecoder::seek (VideoContent::Frame frame, bool accurate)
r = avcodec_decode_video2 (video_codec_context(), _frame, &finished, &_packet);
if (r >= 0 && finished) {
_video_position = rint (
- (av_frame_get_best_effort_timestamp (_frame) * time_base + _pts_offset) * _ffmpeg_content->video_frame_rate()
+ (av_frame_get_best_effort_timestamp (_frame) * time_base + _pts_offset) * _ffmpeg_content->original_video_frame_rate()
);
if (_video_position >= (frame - 1)) {
@@ -495,12 +493,12 @@ FFmpegDecoder::decode_video_packet ()
/* We just did a seek, so disable any attempts to correct for where we
are / should be.
*/
- _video_position = rint (pts * _ffmpeg_content->video_frame_rate ());
+ _video_position = rint (pts * _ffmpeg_content->original_video_frame_rate ());
_just_sought = false;
}
- double const next = _video_position / _ffmpeg_content->video_frame_rate();
- double const one_frame = 1 / _ffmpeg_content->video_frame_rate ();
+ double const next = _video_position / _ffmpeg_content->original_video_frame_rate();
+ double const one_frame = 1 / _ffmpeg_content->original_video_frame_rate ();
double delta = pts - next;
while (delta > one_frame) {