Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / fileexr.C
index fbc3986221a3658700feebe4fd8c61c1000718e2..a705f6c88c8b51eed59773db6201193ac3a23b47 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2003-2016 Cinelerra CV contributors
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -311,6 +312,9 @@ int FileEXR::read_frame_header(char *path)
 
 int FileEXR::read_frame(VFrame *frame, VFrame *data)
 {
+
+    try {
+
        Imf::setGlobalThreadCount(file->cpus);
        EXRIStream exr_stream((char*)data->get_data(), data->get_compressed_size());
        Imf::InputFile file(exr_stream);
@@ -425,6 +429,10 @@ int FileEXR::read_frame(VFrame *frame, VFrame *data)
                }
        }
        return 0;
+    } catch (const std::exception &e) {
+    std::cerr << "error reading EXR image file:" << e.what() << std::endl;
+    return 1;
+    }
 }
 
 
@@ -506,6 +514,15 @@ int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
        return 0;
 }
 
+int FileEXR::can_copy_from(Asset *asset, int64_t position)
+{
+       if(asset->format == FILE_EXR ||
+               asset->format == FILE_EXR_LIST)
+               return 1;
+
+       return 0;
+}
+
 FrameWriterUnit* FileEXR::new_writer_unit(FrameWriter *writer)
 {
        return new EXRUnit(this, writer);