X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Findexfile.C;h=0337d0c2062d9e932051f86721b2939c7f61d1a9;hp=3c6fd97f742e735d3941d9a0e775e52682e26d41;hb=54b918a8b84f666bf32548ebd12b93908061d2a6;hpb=83c58d6d78f6bf0d1d1fd4cfba8654906fe6ec29 diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C index 3c6fd97f..0337d0c2 100644 --- a/cinelerra-5.1/cinelerra/indexfile.C +++ b/cinelerra-5.1/cinelerra/indexfile.C @@ -70,19 +70,22 @@ #include #include +#ifdef HAVE_ISOFS #include +#endif // check for isofs volume_id for dvd/cdrom static int udf_volume_id(const char *path, char *fname) { + int result = 1; +#ifdef HAVE_ISOFS struct stat st; if( stat(path,&st) ) return 1; // search mounted devices FILE *fp = fopen("/proc/mounts","r"); if( !fp ) return 1; - int result = 1; while( result && !feof(fp) && !ferror(fp) ) { char devpath[BCTEXTLEN], mpath[BCTEXTLEN]; char options[BCTEXTLEN], line[BCTEXTLEN]; @@ -122,6 +125,7 @@ static int udf_volume_id(const char *path, char *fname) } fclose(fp); +#endif return result; } @@ -224,7 +228,7 @@ void IndexFile::delete_index(Preferences *preferences, char index_filename[BCTEXTLEN]; char source_filename[BCTEXTLEN]; const char *path = indexable->path; - + if( !*path ) return; get_index_filename(source_filename, preferences->index_directory, index_filename, path, suffix); @@ -370,9 +374,10 @@ void IndexFile::close_source() delete render_engine; render_engine = 0; - - delete cache; - cache = 0; + if( cache ) { + cache->remove_user(); + cache = 0; + } } int64_t IndexFile::get_required_scale() @@ -703,10 +708,9 @@ SET_TRACE // Start and length of fragment to read from file in bytes. float *buffer = 0; int buffer_shared = 0; - int rect_audio = mwindow->preferences->rectify_audio;; - int center_pixel = !rect_audio ? - mwindow->edl->local_session->zoom_track / 2 : - mwindow->edl->local_session->zoom_track; + int rect_audio = mwindow->preferences->rectify_audio; + int data_h = edit->track->data_h; + int center_pixel = !rect_audio ? data_h/2 : data_h; if( edit->track->show_titles() ) center_pixel += mwindow->theme->get_image("title_bg_data")->get_h(); @@ -743,9 +747,9 @@ SET_TRACE int prev_y1 = center_pixel; int prev_y2 = center_pixel; int first_frame = 1; - int zoom_y = !rect_audio ? - mwindow->edl->local_session->zoom_y / 2 : - mwindow->edl->local_session->zoom_y; + int zoom_y = mwindow->edl->local_session->zoom_y * data_h / + mwindow->edl->local_session->zoom_atrack; + if( !rect_audio ) zoom_y /= 2; int max_y = center_pixel + zoom_y - 1; edit_position = (x + pixmap->pixmap_x - virtual_edit_x) * project_zoom; int64_t speed_position = edit->startsource; @@ -786,7 +790,7 @@ SET_TRACE // A different algorithm has to be used if it's 1 sample per pixel and the // index is used. Now the min and max values are equal so we join the max samples. if(mwindow->edl->local_session->zoom_sample == 1) { - canvas->draw_line(x2 - 1, !rect_audio ? prev_y1 : center_pixel, x2, y1, pixmap); + canvas->draw_bline(x2 - 1, !rect_audio ? prev_y1 : center_pixel, x2, y1, pixmap); } else { // Extend line height if it doesn't connect to previous line @@ -797,7 +801,7 @@ SET_TRACE else { first_frame = 0; } - canvas->draw_line(x2, y1, x2, !rect_audio ? y2 : center_pixel, pixmap); + canvas->draw_bline(x2, y1, x2, !rect_audio ? y2 : center_pixel, pixmap); } prev_y1 = next_y1; prev_y2 = next_y2;