X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fedl.C;h=1b00471bce325a5c89a3dd8ba647e054991f68ef;hb=0983c78067d86d25426fd34655ad9a9992ef04c7;hp=d1d904aa795647605031cf3df393e4fbf5f7a181;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index d1d904aa..1b00471b 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -35,6 +35,7 @@ #include "filexml.h" #include "guicast.h" #include "indexstate.h" +#include "interlacemodes.h" #include "labels.h" #include "localsession.h" #include "mutex.h" @@ -74,9 +75,9 @@ EDL::EDL(EDL *parent_edl) folders.set_array_delete(); - new_folder(CLIP_FOLDER); - - new_folder(MEDIA_FOLDER); +// persistent for now +// new_folder(CLIP_FOLDER); +// new_folder(MEDIA_FOLDER); id = next_id(); path[0] = 0; @@ -277,6 +278,8 @@ int EDL::load_xml(FileXML *file, if((load_flags & LOAD_VCONFIG) && (load_flags & LOAD_SESSION)) session->load_video_config(file, 0, load_flags); + else + result = file->skip_tag(); } else if(file->tag.title_is("AUDIO")) @@ -284,6 +287,8 @@ int EDL::load_xml(FileXML *file, if((load_flags & LOAD_ACONFIG) && (load_flags & LOAD_SESSION)) session->load_audio_config(file, 0, load_flags); + else + result = file->skip_tag(); } else if(file->tag.title_is("FOLDER")) @@ -297,12 +302,16 @@ int EDL::load_xml(FileXML *file, { if(load_flags & LOAD_ASSETS) assets->load(file, load_flags); + else + result = file->skip_tag(); } else if(file->tag.title_is(labels->xml_tag)) { if(load_flags & LOAD_TIMEBAR) labels->load(file, load_flags); + else + result = file->skip_tag(); } else if(file->tag.title_is("LOCALSESSION")) @@ -310,6 +319,8 @@ int EDL::load_xml(FileXML *file, if((load_flags & LOAD_SESSION) || (load_flags & LOAD_TIMEBAR)) local_session->load_xml(file, load_flags); + else + result = file->skip_tag(); } else if(file->tag.title_is("SESSION")) @@ -317,6 +328,8 @@ int EDL::load_xml(FileXML *file, if((load_flags & LOAD_SESSION) && !parent_edl) session->load_xml(file, 0, load_flags); + else + result = file->skip_tag(); } else if(file->tag.title_is("TRACK")) @@ -1023,7 +1036,7 @@ int EDL::dump(FILE *fp) local_session->loop_end); for(int i = 0; i < TOTAL_PANES; i++) { - fprintf(fp," pane %d view_start=%jd track_start=%jd\n", i, + fprintf(fp," pane %d view_start=%jd track_start=%d\n", i, local_session->view_start[i], local_session->track_start[i]); } @@ -1285,48 +1298,12 @@ void EDL::get_shared_tracks(Track *track, // Convert position to frames if cursor alignment is enabled double EDL::align_to_frame(double position, int round) { -//printf("EDL::align_to_frame 1 %f\n", position); - if(session->cursor_on_frames) - { -// Seconds -> Frames - double temp = (double)position * session->frame_rate; -//printf("EDL::align_to_frame 2 %f\n", temp); - -// Assert some things - if(session->sample_rate == 0) - printf("EDL::align_to_frame: sample_rate == 0\n"); - - if(session->frame_rate == 0) - printf("EDL::align_to_frame: frame_rate == 0\n"); - -// Round frames -// Always round down negative numbers -// but round up only if requested - if(round) - { - temp = Units::round(temp); - } - else - { -// if(temp < 0) -// { -// temp -= 0.5; -// } -// else - temp = Units::to_int64(temp); - } -//printf("EDL::align_to_frame 3 %f\n", temp); - -// Frames -> Seconds - temp /= session->frame_rate; - -//printf("EDL::align_to_frame 5 %f\n", temp); - - return temp; + if( session->cursor_on_frames && session->frame_rate > 0 ) { + double frame_no = position * session->frame_rate; + int64_t frame_pos = frame_no + (round ? 0.5 : 1e-6); + double pos = frame_pos / session->frame_rate; + if( !EQUIV(pos, position) ) position = pos; } -//printf("EDL::align_to_frame 3 %d\n", position); - - return position; } @@ -1448,20 +1425,23 @@ if(debug) printf("EDL::get_use_vconsole %d\n", __LINE__); if(debug) printf("EDL::get_use_vconsole %d\n", __LINE__); // Edit is not a nested EDL + Asset *asset = (*playable_edit)->asset; // Edit is silence - if(!(*playable_edit)->asset) return 1; + if(!asset) return 1; if(debug) printf("EDL::get_use_vconsole %d\n", __LINE__); - // Asset and output device must have the same dimensions - if((*playable_edit)->asset->width != session->output_w || - (*playable_edit)->asset->height != session->output_h) + if( asset->width != session->output_w || + asset->height != session->output_h ) return 1; if(debug) printf("EDL::get_use_vconsole %d\n", __LINE__); - - +// Asset and output device must have same resulting de-interlacing method + if( ilaceautofixmethod2(session->interlace_mode, + asset->interlace_autofixoption, asset->interlace_mode, + asset->interlace_fixmethod) != ILACE_FIXMETHOD_NONE ) + return 1; // If we get here the frame is going to be directly copied. Whether it is // decompressed in hardware depends on the colormodel.