summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-19 23:50:17 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-19 23:50:17 +0000
commit2f56f38ce56b36f20d59593f56981e7ed330c484 (patch)
tree1889f6eff9545010815775671df54064bc796201 /src/lib/ffmpeg_decoder.cc
parent13337c62d8c0d052ba0377af9c00fe1d940be3cc (diff)
Re-work again so that there's just one encoder; various tweaks to still-image-with-audio.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 60bb3271e..a19f26ad7 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -572,10 +572,8 @@ FFmpegDecoder::filter_and_emit_video (AVFrame* frame)
list<shared_ptr<Image> > images = graph->process (frame);
- double const st = av_frame_get_best_effort_timestamp(_frame) * av_q2d (_format_context->streams[_video_stream]->time_base);
-
for (list<shared_ptr<Image> >::iterator i = images.begin(); i != images.end(); ++i) {
- emit_video (*i, st);
+ emit_video (*i, frame_time ());
}
}
@@ -694,7 +692,7 @@ FFmpegDecoder::out_with_sync ()
String::compose (
"Extra video frame inserted at %1s; source frame %2, source PTS %3 (at %4 fps)",
out_pts_seconds, video_frame(), source_pts_seconds, frames_per_second()
- )
+ )
);
}
}
@@ -733,3 +731,9 @@ FFmpegDecoder::length () const
return (double(_format_context->duration) / AV_TIME_BASE) * frames_per_second();
}
+double
+FFmpegDecoder::frame_time () const
+{
+ return av_frame_get_best_effort_timestamp(_frame) * av_q2d (_format_context->streams[_video_stream]->time_base);
+}
+