colorpicker cleanup, make ffmpeg probes early default
[goodguy/history.git] / cinelerra-5.1 / cinelerra / indexfile.C
index bdb928cee301ad8b5739d83c7f1eaae6f0ba5fb0..a5f12bcaaa1dda0272fbe9da5a485a172c82b4d3 100644 (file)
@@ -336,7 +336,7 @@ int IndexFile::open_source()
                command.realtime = 0;
                cache = new CICache(mwindow->preferences);
                render_engine = new RenderEngine(0,
-                       mwindow->preferences, 0, 0, 0);
+                       mwindow->preferences, 0, 0);
                render_engine->set_acache(cache);
                render_engine->arm_command(&command);
                FileSystem fs;
@@ -738,9 +738,7 @@ SET_TRACE
        int prev_y2 = center_pixel;
        int first_frame = 1;
        int zoom_y = mwindow->edl->local_session->zoom_y, zoom_y2 = zoom_y / 2;
-       int max_y = canvas->get_h();
-       int zmax_y = center_pixel + zoom_y2 - 1;
-       if( zmax_y < max_y ) max_y = zmax_y;
+       int max_y = center_pixel + zoom_y2 - 1;
 SET_TRACE
 
        for(int bufferposition = 0;
@@ -868,16 +866,19 @@ int IndexFile::read_info(Indexable *test_indexable)
 // Read the file format & index state.
                if(test_indexable->is_asset)
                {
-                       Asset *asset = (Asset*)test_indexable;
+                       Asset *test_asset = (Asset *)test_indexable;
+                       Asset *asset = new Asset;
                        asset->read(&xml);
-
+                       int ret = 0;
 //printf("IndexFile::read_info %d %f\n", __LINE__, asset->get_frame_rate());
 
-                       if(asset->format == FILE_UNKNOWN)
-                       {
+                       if( asset->format == FILE_UNKNOWN ||
+                           test_asset->format != asset->format ) {
 if(debug) printf("IndexFile::read_info %d\n", __LINE__);
-                               return 1;
+                               ret = 1;
                        }
+                       asset->remove_user();
+                       if( ret ) return ret;
                }
                else
                {