X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Findexable.C;h=fa86e313828488d74f5951cf195d4f3cba938dcc;hb=63c49c5fdda77aadc2d0addc26a6884aadec8542;hp=865877d8ad17700c4a1bfde50dc933d20d15dfda;hpb=2d99bb8ce591f05a31464b517d85dc2bc35b2abe;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/indexable.C b/cinelerra-5.0/cinelerra/indexable.C index 865877d8..fa86e313 100644 --- a/cinelerra-5.0/cinelerra/indexable.C +++ b/cinelerra-5.0/cinelerra/indexable.C @@ -28,7 +28,6 @@ Indexable::Indexable(int is_asset) : Garbage(is_asset ? "Asset" : "EDL") { index_state = new IndexState; - index_state->reset(); this->is_asset = is_asset; strcpy(folder, MEDIA_FOLDER); } @@ -36,7 +35,7 @@ Indexable::Indexable(int is_asset) : Garbage(is_asset ? "Asset" : "EDL") Indexable::~Indexable() { - delete index_state; + index_state->remove_user(); } int Indexable::get_audio_channels() @@ -54,13 +53,26 @@ int64_t Indexable::get_audio_samples() return 0; } +void Indexable::update_path(char *new_path) +{ + strcpy(path, new_path); +} + +void Indexable::update_index(Indexable *src) +{ + index_state->remove_user(); + index_state = src->index_state; + index_state->add_user(); +} + void Indexable::copy_indexable(Indexable *src) { - strcpy(path, src->path); - index_state->copy_from(src->index_state); + if( this == src ) return; + update_path(src->path); + update_index(src); } int Indexable::have_audio()