Still encoder should write frames starting at 0, not 1
authorCarl Hetherington <cth@carlh.net>
Tue, 24 Jul 2012 18:44:57 +0000 (19:44 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 24 Jul 2012 18:44:57 +0000 (19:44 +0100)
src/lib/j2k_still_encoder.cc

index e7b0c40da28356201d61df8b2c482ecdb52e9b13..a42d0d4763da8cadabeb9cd61b00ed2410a93977 100644 (file)
@@ -57,13 +57,13 @@ J2KStillEncoder::process_video (shared_ptr<Image> yuv, int frame)
                _log
                );
 
-       if (!boost::filesystem::exists (_opt->frame_out_path (1, false))) {
+       if (!boost::filesystem::exists (_opt->frame_out_path (0, false))) {
                boost::shared_ptr<EncodedData> e = f->encode_locally ();
-               e->write (_opt, 1);
+               e->write (_opt, 0);
        }
 
        string const real = _opt->frame_out_path (1, false);
-       for (int i = 2; i <= (_fs->still_duration * ImageMagickDecoder::static_frames_per_second()); ++i) {
+       for (int i = 1; i < (_fs->still_duration * ImageMagickDecoder::static_frames_per_second()); ++i) {
                if (!boost::filesystem::exists (_opt->frame_out_path (i, false))) {
                        string const link = _opt->frame_out_path (i, false);
 #ifdef DVDOMATIC_POSIX