~mbranton/libopenshot/alpha-channel-fix

« back to all changes in this revision

Viewing changes to src/Timeline.cpp

  • Committer: Jonathan Thomas
  • Date: 2016-09-14 09:11:12 UTC
  • Revision ID: jonathan@openshot.org-20160914091112-mcxg747f4zniwscx
Added SetMaxSize for image optimizations in QImageReader and FFmpegReader, which lets the timeline pass down the max size to all clips and readers, so they can optionally optimize the size of images (especially useful for optimizing preview performance). Removed convoluted image scaling code in FFmpegReader, and replaced with simpler version. Also, fixed a few regressions from the new Caching code, primarily a crash when reaching the end of the last clip on the timeline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
                // Debug output
206
206
                ZmqLogger::Instance()->AppendDebugMethod("Timeline::GetOrCreateFrame (from reader)", "number", number, "samples_in_frame", samples_in_frame, "", -1, "", -1, "", -1, "", -1);
207
207
 
 
208
                // Set max image size (used for performance optimization)
 
209
                clip->SetMaxSize(info.width, info.height);
 
210
 
208
211
                // Attempt to get a frame (but this could fail if a reader has just been closed)
209
212
                new_frame = tr1::shared_ptr<Frame>(clip->GetFrame(number));
210
213
 
749
752
                                // Debug output
750
753
                                ZmqLogger::Instance()->AppendDebugMethod("Timeline::GetFrame (Add frame to cache)", "frame_number", frame_number, "info.width", info.width, "info.height", info.height, "", -1, "", -1, "", -1);
751
754
 
 
755
                                // Set frame # on mapped frame
 
756
                                new_frame->SetFrameNumber(frame_number);
 
757
 
752
758
                                // Add final frame to cache
753
759
                                final_cache->Add(new_frame);
754
760