projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
version update
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
cinelerra
/
indexfile.C
diff --git
a/cinelerra-5.1/cinelerra/indexfile.C
b/cinelerra-5.1/cinelerra/indexfile.C
index 87b8853a28344ad1059a25b59be72910f08e2ac9..16175535e96a0f1e876a893ca07d2b66c5a347c5 100644
(file)
--- a/
cinelerra-5.1/cinelerra/indexfile.C
+++ b/
cinelerra-5.1/cinelerra/indexfile.C
@@
-2,6
+2,7
@@
/*
* CINELERRA
* Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
/*
* CINELERRA
* Copyright (C) 1997-2014 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
*
* 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
@@
-73,6
+74,9
@@
#ifdef HAVE_ISOFS
#include <linux/iso_fs.h>
#endif
#ifdef HAVE_ISOFS
#include <linux/iso_fs.h>
#endif
+#if defined(__FreeBSD__)
+#include <isofs/cd9660/iso.h>
+#endif
// check for isofs volume_id for dvd/cdrom
// check for isofs volume_id for dvd/cdrom
@@
-228,7
+232,7
@@
void IndexFile::delete_index(Preferences *preferences,
char index_filename[BCTEXTLEN];
char source_filename[BCTEXTLEN];
const char *path = indexable->path;
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);
get_index_filename(source_filename,
preferences->index_directory,
index_filename, path, suffix);
@@
-350,7
+354,7
@@
int IndexFile::open_source()
}
else
{
}
else
{
- TransportCommand command;
+ TransportCommand command
(mwindow->preferences)
;
command.command = NORMAL_FWD;
command.get_edl()->copy_all((EDL*)indexable);
command.change_type = CHANGE_ALL;
command.command = NORMAL_FWD;
command.get_edl()->copy_all((EDL*)indexable);
command.change_type = CHANGE_ALL;
@@
-374,9
+378,10
@@
void IndexFile::close_source()
delete render_engine;
render_engine = 0;
delete render_engine;
render_engine = 0;
-
- delete cache;
- cache = 0;
+ if( cache ) {
+ cache->remove_user();
+ cache = 0;
+ }
}
int64_t IndexFile::get_required_scale()
}
int64_t IndexFile::get_required_scale()
@@
-707,10
+712,9
@@
SET_TRACE
// Start and length of fragment to read from file in bytes.
float *buffer = 0;
int buffer_shared = 0;
// 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();
if( edit->track->show_titles() )
center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
@@
-747,9
+751,9
@@
SET_TRACE
int prev_y1 = center_pixel;
int prev_y2 = center_pixel;
int first_frame = 1;
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;
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;
@@
-790,7
+794,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) {
// 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_
b
line(x2 - 1, !rect_audio ? prev_y1 : center_pixel, x2, y1, pixmap);
}
else {
// Extend line height if it doesn't connect to previous line
}
else {
// Extend line height if it doesn't connect to previous line
@@
-801,7
+805,7
@@
SET_TRACE
else {
first_frame = 0;
}
else {
first_frame = 0;
}
- canvas->draw_line(x2, y1, x2, !rect_audio ? y2 : center_pixel, pixmap);
+ canvas->draw_
b
line(x2, y1, x2, !rect_audio ? y2 : center_pixel, pixmap);
}
prev_y1 = next_y1;
prev_y2 = next_y2;
}
prev_y1 = next_y1;
prev_y2 = next_y2;
@@
-859,7
+863,8
@@
int IndexFile::read_info(Indexable *test_indexable)
data = new char[index_state->index_start];
temp = fread(data, index_state->index_start - sizeof(int64_t), 1, fd);
data = new char[index_state->index_start];
temp = fread(data, index_state->index_start - sizeof(int64_t), 1, fd);
- if(!temp) return 1;
+ if(!temp) { delete [] data;
+ return 1;}
data[index_state->index_start - sizeof(int64_t)] = 0;
FileXML xml;
data[index_state->index_start - sizeof(int64_t)] = 0;
FileXML xml;