#include "image.h"
#include "log.h"
+#include "i18n.h"
+
using std::min;
using boost::shared_ptr;
-Matcher::Matcher (Log* log, int sample_rate, float frames_per_second)
+Matcher::Matcher (shared_ptr<Log> log, int sample_rate, float frames_per_second)
: AudioVideoProcessor (log)
, _sample_rate (sample_rate)
, _frames_per_second (frames_per_second)
}
void
-Matcher::process_video (boost::shared_ptr<Image> i, bool same, boost::shared_ptr<Subtitle> s)
+Matcher::process_video (shared_ptr<Image> i, bool same, shared_ptr<Subtitle> s)
{
Video (i, same, s);
_video_frames++;
}
void
-Matcher::process_audio (boost::shared_ptr<AudioBuffers> b)
+Matcher::process_audio (shared_ptr<AudioBuffers> b)
{
Audio (b);
_audio_frames += b->frames ();
_log->log (
String::compose (
- "Matching processor has seen %1 video frames (which equals %2 audio frames) and %3 audio frames",
+ N_("Matching processor has seen %1 video frames (which equals %2 audio frames) and %3 audio frames"),
_video_frames,
video_frames_to_audio_frames (_video_frames, _sample_rate, _frames_per_second),
_audio_frames
if (audio_short_by_frames < 0) {
- _log->log (String::compose ("%1 too many audio frames", -audio_short_by_frames));
+ _log->log (String::compose (N_("%1 too many audio frames"), -audio_short_by_frames));
/* We have seen more audio than video. Emit enough black video frames so that we reverse this */
int const black_video_frames = ceil (-audio_short_by_frames * _frames_per_second / _sample_rate);
- _log->log (String::compose ("Emitting %1 frames of black video", black_video_frames));
+ _log->log (String::compose (N_("Emitting %1 frames of black video"), black_video_frames));
- shared_ptr<Image> black (new SimpleImage (_pixel_format.get(), _size.get(), false));
+ shared_ptr<Image> black (new SimpleImage (_pixel_format.get(), _size.get(), true));
black->make_black ();
for (int i = 0; i < black_video_frames; ++i) {
Video (black, i != 0, shared_ptr<Subtitle>());
}
if (audio_short_by_frames > 0) {
- _log->log (String::compose ("Emitted %1 too few audio frames", audio_short_by_frames));
+ _log->log (String::compose (N_("Emitted %1 too few audio frames"), audio_short_by_frames));
/* Do things in half second blocks as I think there may be limits
to what FFmpeg (and in particular the resampler) can cope with.