diff --git a/examples/Example.cpp b/examples/Example.cpp index 16d6a675..a11bb5ab 100644 --- a/examples/Example.cpp +++ b/examples/Example.cpp @@ -44,9 +44,6 @@ int main(int argc, char* argv[]) { using s = std::chrono::seconds; using double_ms = std::chrono::duration; - // Track total time - const auto total_time = double_ms(0.0); - // FFmpeg Reader performance test const auto total_1 = std::chrono::high_resolution_clock::now(); FFmpegReader r9("/home/jonathan/Videos/sintel_trailer-1080p.mp4"); @@ -64,7 +61,6 @@ int main(int argc, char* argv[]) { r9.Close(); - // Timeline Reader performance test Timeline tm(r9.info.width, r9.info.height, r9.info.fps, r9.info.sample_rate, r9.info.channels, r9.info.channel_layout); Clip *c = new Clip(&r9); diff --git a/src/Clip.cpp b/src/Clip.cpp index 55dcf262..a57b2836 100644 --- a/src/Clip.cpp +++ b/src/Clip.cpp @@ -354,18 +354,6 @@ std::shared_ptr Clip::GetFrame(std::shared_ptr backgroun // Adjust out of bounds frame number frame_number = adjust_frame_number_minimum(frame_number); - // Adjust has_video and has_audio overrides - int enabled_audio = has_audio.GetInt(frame_number); - if (enabled_audio == -1 && reader && reader->info.has_audio) - enabled_audio = 1; - else if (enabled_audio == -1 && reader && !reader->info.has_audio) - enabled_audio = 0; - int enabled_video = has_video.GetInt(frame_number); - if (enabled_video == -1 && reader && reader->info.has_video) - enabled_video = 1; - else if (enabled_video == -1 && reader && !reader->info.has_video) - enabled_video = 0; - // Is a time map detected int64_t new_frame_number = frame_number; int64_t time_mapped_number = adjust_frame_number_minimum(time.GetLong(frame_number)); @@ -382,19 +370,6 @@ std::shared_ptr Clip::GetFrame(std::shared_ptr backgroun // Apply effects to the frame (if any) apply_effects(original_frame); - // Determine size of image (from Timeline or Reader) - int width = 0; - int height = 0; - if (timeline) { - // Use timeline size (if available) - width = timeline->preview_width; - height = timeline->preview_height; - } else { - // Fallback to clip size - width = reader->info.width; - height = reader->info.height; - } - // Apply keyframe / transforms apply_keyframes(original_frame, background_frame->GetImage()); diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index a5e18003..a64e5230 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1244,7 +1244,6 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) { // Create variables for a RGB Frame (since most videos are not in RGB, we must convert it) AVFrame *pFrameRGB = NULL; - int numBytes; uint8_t *buffer = NULL; // Allocate an AVFrame structure @@ -1318,7 +1317,6 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) { } // Determine required buffer size and allocate buffer - numBytes = AV_GET_IMAGE_SIZE(PIX_FMT_RGBA, width, height); const int bytes_per_pixel = 4; int buffer_size = width * height * bytes_per_pixel; buffer = new unsigned char[buffer_size](); @@ -2169,7 +2167,7 @@ void FFmpegReader::CheckWorkingFrames(bool end_of_stream, int64_t requested_fram break; // Remove frames which are too old - if (f && f->number < (requested_frame - (max_concurrent_frames * 2))) { + if (f->number < (requested_frame - (max_concurrent_frames * 2))) { working_cache.Remove(f->number); }