Untested use of Frame for video/audio content lengths.
[dcpomatic.git] / src / lib / dcp_examiner.cc
index 1e4cc899df96df614fd6a9b1413d3101245247a4..a0d13a7224bb42d090d0f26922f0ee8f99ef50f7 100644 (file)
 
 */
 
+#include "dcp_examiner.h"
+#include "dcp_content.h"
+#include "exceptions.h"
+#include "image.h"
+#include "config.h"
 #include <dcp/dcp.h>
 #include <dcp/cpl.h>
 #include <dcp/reel.h>
 #include <dcp/stereo_picture_mxf.h>
 #include <dcp/stereo_picture_frame.h>
 #include <dcp/sound_mxf.h>
-#include "dcp_examiner.h"
-#include "dcp_content.h"
-#include "exceptions.h"
-#include "image.h"
-#include "config.h"
 
 #include "i18n.h"
 
@@ -81,7 +81,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                                throw DCPError (_("Mismatched video sizes in DCP"));
                        }
 
-                       _video_length += ContentTime::from_frames ((*i)->main_picture()->duration(), _video_frame_rate.get ());
+                       _video_length += (*i)->main_picture()->duration();
                }
                        
                if ((*i)->main_sound ()) {
@@ -99,7 +99,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                                throw DCPError (_("Mismatched audio frame rates in DCP"));
                        }
 
-                       _audio_length += ContentTime::from_frames ((*i)->main_sound()->duration(), _video_frame_rate.get ());
+                       _audio_length += (*i)->main_sound()->duration();
                }
 
                if ((*i)->main_subtitle ()) {
@@ -117,12 +117,10 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                        shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf);
                        shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf);
                        
-                       shared_ptr<Image> image (new Image (PIX_FMT_RGB24, _video_size.get(), false));
-                       
                        if (mono) {
-                               mono->get_frame(0)->rgb_frame (image->data()[0]);
+                               mono->get_frame(0)->xyz_image ();
                        } else {
-                               stereo->get_frame(0)->rgb_frame (dcp::EYE_LEFT, image->data()[0]);
+                               stereo->get_frame(0)->xyz_image (dcp::EYE_LEFT);
                        }
                        
                }