prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / file.C
index 294c6c6c52bc6f89f55c049ed840c0711135d145..3b1fac49be41d91b603e7c4e117e96c01a2b1645 100644 (file)
@@ -40,7 +40,6 @@
 #include "condition.h"
 #include "errorbox.h"
 #include "fileac3.h"
-#include "fileavi.h"
 #include "filebase.h"
 #include "filecr2.h"
 #include "filedb.h"
 #include "fileexr.h"
 #include "fileffmpeg.h"
 #include "fileflac.h"
-#include "filefork.h"
 #include "filegif.h"
 #include "file.h"
 #include "filejpeg.h"
-#include "filemov.h"
 #include "filempeg.h"
 #undef HAVE_STDLIB_H // automake conflict
 #include "fileogg.h"
 #include "filepng.h"
 #include "filescene.h"
-#include "fileserver.h"
 #include "filesndfile.h"
 #include "filetga.h"
 #include "filethread.h"
 #include "pluginserver.h"
 #include "preferences.h"
 #include "samples.h"
-#include "stringfile.h"
 #include "vframe.h"
 
-
-
+//suppress noref warning
+void *vorbis0_ov_callbacks[] = {
+ &OV_CALLBACKS_DEFAULT, &OV_CALLBACKS_NOCLOSE,
+ &OV_CALLBACKS_STREAMONLY, &OV_CALLBACKS_STREAMONLY_NOCLOSE,
+};
 
 File::File()
 {
@@ -89,9 +87,6 @@ File::File()
        format_completion = new Condition(1, "File::format_completion");
        write_lock = new Condition(1, "File::write_lock");
        frame_cache = new FrameCache;
-#ifdef USE_FILEFORK
-       forked = new Mutex("File::forked",0);
-#endif
        reset_parameters();
 }
 
@@ -112,19 +107,11 @@ File::~File()
        asset->Garbage::remove_user();
        delete format_completion;
        delete write_lock;
-#ifdef USE_FILEFORK
-       delete forked;
-#endif
        delete frame_cache;
 }
 
 void File::reset_parameters()
 {
-#ifdef USE_FILEFORK
-       file_fork = 0;
-       is_fork = 0;
-#endif
-
        file = 0;
        audio_thread = 0;
        video_thread = 0;
@@ -178,7 +165,6 @@ int File::get_options(FormatTools *format,
        BC_WindowBase *parent_window = format->window;
        //ArrayList<PluginServer*> *plugindb = format->plugindb;
        Asset *asset = format->asset;
-       const char *locked_compressor = format->locked_compressor;
 
        getting_options = 1;
        format_completion->lock("File::get_options");
@@ -209,14 +195,6 @@ int File::get_options(FormatTools *format,
                                audio_options, 
                                video_options);
                        break;
-               case FILE_MOV:
-                       FileMOV::get_parameters(parent_window, 
-                               asset, 
-                               format_window, 
-                               audio_options, 
-                               video_options,
-                               locked_compressor);
-                       break;
                case FILE_FFMPEG:
                        FileFFMPEG::get_parameters(parent_window, 
                                asset, 
@@ -232,25 +210,6 @@ int File::get_options(FormatTools *format,
                                audio_options, 
                                video_options);
                        break;
-               case FILE_AVI:
-                       FileMOV::get_parameters(parent_window, 
-                               asset, 
-                               format_window, 
-                               audio_options, 
-                               video_options,
-                               locked_compressor);
-                       break;
-               case FILE_AVI_LAVTOOLS:
-               case FILE_AVI_ARNE2:
-               case FILE_AVI_ARNE1:
-               case FILE_AVI_AVIFILE:
-                       FileAVI::get_parameters(parent_window, 
-                               asset, 
-                               format_window, 
-                               audio_options, 
-                               video_options,
-                               locked_compressor);
-                       break;
                case FILE_JPEG:
                case FILE_JPEG_LIST:
                        FileJPEG::get_parameters(parent_window, 
@@ -311,7 +270,7 @@ int File::get_options(FormatTools *format,
 
        if(!format_window)
        {
-               ErrorBox *errorbox = new ErrorBox(PROGRAM_NAME ": Error",
+               ErrorBox *errorbox = new ErrorBox(_(PROGRAM_NAME ": Error"),
                        parent_window->get_abs_cursor_x(1),
                        parent_window->get_abs_cursor_y(1));
                format_window = errorbox;
@@ -344,15 +303,6 @@ int File::set_processors(int cpus)   // Set the number of cpus for certain codec
 {
        if( cpus > 8 )          // mpegvideo max_threads = 16, more causes errs
                cpus = 8;       //  8 cpus ought to decode just about anything
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_PROCESSORS, (unsigned char*)&cpus, sizeof(cpus));
-               file_fork->read_result();
-       }
-#endif
-
 // Set all instances so gets work.
        this->cpus = cpus;
 
@@ -361,61 +311,23 @@ int File::set_processors(int cpus)   // Set the number of cpus for certain codec
 
 int File::set_preload(int64_t size)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_PRELOAD, (unsigned char*)&size, sizeof(size));
-               file_fork->read_result();
-       }
-
-#endif
-
        this->playback_preload = size;
        return 0;
 }
 
 void File::set_subtitle(int value)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_SUBTITLE, (unsigned char*)&value, sizeof(value));
-               file_fork->read_result();
-       }
-
-#endif
        this->playback_subtitle = value;
        if( file ) file->set_subtitle(value);
 }
 
 void File::set_interpolate_raw(int value)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_INTERPOLATE_RAW, (unsigned char*)&value, sizeof(value));
-               file_fork->read_result();
-       }
-
-#endif
-
        this->interpolate_raw = value;
 }
 
 void File::set_white_balance_raw(int value)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_WHITE_BALANCE_RAW, (unsigned char*)&value, sizeof(value));
-               file_fork->read_result();
-       }
-#endif
-
        this->white_balance_raw = value;
 }
 
@@ -460,7 +372,6 @@ int File::open_file(Preferences *preferences,
        int rd, 
        int wr)
 {
-       int result = 0;
        const int debug = 0;
 
        this->preferences = preferences;
@@ -471,83 +382,6 @@ int File::open_file(Preferences *preferences,
 
        if(debug) printf("File::open_file %d\n", __LINE__);
 
-#ifdef USE_FILEFORK
-       if( !is_fork && MWindow::file_server && (rd || wr) ) {
-               FileForker this_is(*forked);
-// printf("File::open_file %d file_server=%p rd=%d wr=%d %d\n", 
-// __LINE__, 
-// MWindow::file_server,
-// rd, 
-// wr, 
-// asset->ms_quantization);
-               file_fork = MWindow::file_server->new_filefork();
-//printf("File::open_file %d\n", __LINE__);
-
-// Send the asset
-// Convert to hash table
-               BC_Hash table;
-               asset->save_defaults(&table, "", 1, 1, 1, 1, 1);
-// Convert to string
-               char *string = 0;
-               table.save_string(string);
-               int buffer_size = sizeof(int) * 7 + strlen(string) + 1;
-               unsigned char *buffer = new unsigned char[buffer_size];
-               int offset = 0;
-               *(int*)(buffer + offset) = rd;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = wr;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = cpus;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = white_balance_raw;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = interpolate_raw;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = playback_subtitle;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = current_program;
-               offset += sizeof(int);
-               memcpy(buffer + offset, string, strlen(string) + 1);
-//printf("File::open_file %d\n", __LINE__);
-               file_fork->send_command(FileFork::OPEN_FILE, 
-                       buffer, 
-                       buffer_size);
-               delete [] buffer;
-               delete [] string;
-//printf("File::open_file %d\n", __LINE__);
-
-// Get the updated asset from the fork
-               result = file_fork->read_result();
-//printf("File::open_file %d\n", __LINE__);
-               if(!result)
-               {
-                       table.load_string((char*)file_fork->result_data);
-
-                       asset->load_defaults(&table, "", 1, 1, 1, 1, 1);
-                       this->asset->load_defaults(&table, "", 1, 1, 1, 1, 1);
-//this->asset->dump();
-               }
-//printf("File::open_file %d\n", __LINE__);
-
-
-// If it's a scene renderer, close it & reopen it locally to get the 
-// full OpenGL support.
-// Just doing 2D for now.  Should be forked in case Festival crashes.
-//             if(rd && this->asset->format == FILE_SCENE)
-//             {
-// //printf("File::open_file %p %d\n", this, __LINE__);
-//                     close_file(0);
-// // Lie to get it to work properly
-//                     is_fork = 1;
-//             }
-//             else
-               {
-                       return result;
-               }
-       }
-#endif
-
-
        if(debug) printf("File::open_file %p %d\n", this, __LINE__);
 
        switch(this->asset->format)
@@ -574,8 +408,8 @@ int File::open_file(Preferences *preferences,
                                return 1;
                        }
 
-                       char test[16];
-                       result = fread(test, 16, 1, stream);
+                       char test[16];  memset(test,0,sizeof(test)); // int result =
+                       fread(test, 16, 1, stream);
 
                        if(FileScene::check_sig(this->asset, test)) {
 // libsndfile
@@ -669,13 +503,6 @@ int File::open_file(Preferences *preferences,
                                fclose(stream);
                                return FILE_IS_XML;
                        }    // can't load project file
-                       if(FileMOV::check_sig(this->asset)) {
-// MOV file
-// should be last because quicktime lacks a magic number
-                               fclose(stream);
-                               file = new FileMOV(this->asset, this);
-                               break;
-                       }
                        if( !preferences->ffmpeg_early_probe &&
                            FileFFMPEG::check_sig(this->asset) ) {
                                fclose(stream);
@@ -752,10 +579,6 @@ int File::open_file(Preferences *preferences,
                        file = new FileDB(this->asset, this);
                        break;
 
-               case FILE_MOV:
-                       file = new FileMOV(this->asset, this);
-                       break;
-
                case FILE_MPEG:
                case FILE_AMPEG:
                case FILE_VMPEG:
@@ -770,17 +593,6 @@ int File::open_file(Preferences *preferences,
                        file = new FileVorbis(this->asset, this);
                        break;
 
-               case FILE_AVI:
-                       file = new FileMOV(this->asset, this);
-                       break;
-
-               case FILE_AVI_LAVTOOLS:
-               case FILE_AVI_ARNE2:
-               case FILE_AVI_ARNE1:
-               case FILE_AVI_AVIFILE:
-                       file = new FileAVI(this->asset, this);
-                       break;
-
                case FILE_RAWDV:
                        file = new FileDV(this->asset, this);
                        break;
@@ -794,7 +606,7 @@ int File::open_file(Preferences *preferences,
 
 // Reopen file with correct parser and get header.
        if(file->open_file(rd, wr)) {
-               delete file;
+               delete file;  file = 0;
                return FILE_NOT_FOUND;
        }
 
@@ -808,7 +620,7 @@ int File::open_file(Preferences *preferences,
        if( rd ) {
 // one frame image file, no specific length
                if( !this->asset->audio_data && this->asset->video_data &&
-                   this->asset->video_length == 1 )
+                   this->asset->video_length <= 1 )
                        this->asset->video_length = -1;
        }
 
@@ -864,29 +676,6 @@ int File::close_file(int ignore_thread)
 {
        const int debug = 0;
 
-#ifdef USE_FILEFORK
-       if(debug) printf("File::close_file file=%p file_fork=%p %d\n", file, file_fork, __LINE__);
-
-       if(file_fork) {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::CLOSE_FILE, 0, 0);
-               file_fork->read_result();
-
-               if(asset && wr) {
-                       asset->audio_length = current_sample = *(int64_t*)file_fork->result_data;
-                       asset->video_length = current_frame = *(int64_t*)(file_fork->result_data + sizeof(int64_t));
-               }
-
-               if(debug) printf("File::close_file:%d current_sample=" _LD " current_frame=" _LD "\n", 
-                       __LINE__,
-                       current_sample,
-                       current_frame);
-
-               delete file_fork;
-               file_fork = 0;
-       }
-#endif
-
        if(debug) printf("File::close_file file=%p %d\n", file, __LINE__);
 
        if(!ignore_thread) {
@@ -924,15 +713,6 @@ int File::close_file(int ignore_thread)
 
 int File::get_index(char *index_path)
 {
-#ifdef USE_FILEFORK
-       if(file_fork) {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_INDEX, (unsigned char*)index_path, strlen(index_path) + 1);
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        if(file) {
                return file->get_index(index_path);
        }
@@ -945,46 +725,6 @@ int File::start_audio_thread(int buffer_size, int ring_buffers)
 {
        this->audio_ring_buffers = ring_buffers;
 
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               unsigned char buffer[sizeof(int) * 2];
-               int *ibfr = (int *)buffer;
-               ibfr[0] = buffer_size;
-               ibfr[1] = audio_ring_buffers;
-               file_fork->send_command(FileFork::START_AUDIO_THREAD, buffer, sizeof(buffer));
-               int result = file_fork->read_result();
-
-
-//printf("File::start_audio_thread %d file_fork->result_data=%p\n", __LINE__, file_fork->result_data);
-// Create server copy of buffer
-               delete_temp_samples_buffer();
-//printf("File::start_audio_thread %d\n", __LINE__);
-               temp_samples_buffer = new Samples**[audio_ring_buffers];
-//printf("File::start_audio_thread %d\n", __LINE__);
-               for(int i = 0; i < audio_ring_buffers; i++)
-               {
-//printf("File::start_audio_thread %d\n", __LINE__);
-                       temp_samples_buffer[i] = new Samples*[asset->channels];
-//printf("File::start_audio_thread %d\n", __LINE__);
-                       for(int j = 0; j < asset->channels; j++)
-                       {
-                               int offset = i * Samples::filefork_size() * asset->channels +
-                                       j * Samples::filefork_size();
-//printf("File::start_audio_thread %d j=%d offset=%d\n", __LINE__, j, offset);
-                               temp_samples_buffer[i][j] = new Samples;
-                               temp_samples_buffer[i][j]->from_filefork(
-                                       file_fork->result_data +
-                                       offset);
-//printf("File::start_audio_thread %d\n", __LINE__);
-                       }
-               }
-               
-               return result;
-       }
-#endif
-
        
        if(!audio_thread)
        {
@@ -1002,57 +742,6 @@ int File::start_video_thread(int buffer_size,
        this->video_ring_buffers = ring_buffers;
        this->video_buffer_size = buffer_size;
 
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-// This resets variables
-               delete_temp_frame_buffer();
-
-               this->video_ring_buffers = ring_buffers;
-               this->video_buffer_size = buffer_size;
-
-               unsigned char buffer[sizeof(int) * 4];
-               int *ibfr = (int *)buffer;
-               ibfr[0] = buffer_size;
-               ibfr[1] = color_model;
-               ibfr[2] = video_ring_buffers;
-               ibfr[3] = compressed;
-// Buffers are allocated
-               file_fork->send_command(FileFork::START_VIDEO_THREAD, 
-                       buffer, 
-                       sizeof(buffer));
-               int result = file_fork->read_result();
-
-
-// Create server copy of buffer
-//printf("File::start_video_thread %d %d\n", __LINE__, video_ring_buffers);
-               temp_frame_buffer = new VFrame***[video_ring_buffers];
-               for(int i = 0; i < video_ring_buffers; i++)
-               {
-                       temp_frame_buffer[i] = new VFrame**[asset->layers];
-                       for(int j = 0; j < asset->layers; j++)
-                       {
-                               temp_frame_buffer[i][j] = new VFrame*[video_buffer_size];
-//printf("File::start_video_thread %d %p\n", __LINE__, temp_frame_buffer[i][j]);
-                               for(int k = 0; k < video_buffer_size; k++)
-                               {
-                                       temp_frame_buffer[i][j][k] = new VFrame;
-                                       temp_frame_buffer[i][j][k]->from_filefork(file_fork->result_data + 
-                                               i * asset->layers * video_buffer_size * VFrame::filefork_size() + 
-                                               j * video_buffer_size * VFrame::filefork_size() +
-                                               k * VFrame::filefork_size());
-                               }
-                       }
-               }
-
-
-               return result;
-       }
-#endif
-
-
-
        if(!video_thread)
        {
                video_thread = new FileThread(this, 0, 1);
@@ -1066,17 +755,6 @@ int File::start_video_thread(int buffer_size,
 
 int File::start_video_decode_thread()
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::START_VIDEO_DECODE_THREAD, 0, 0);
-               file_fork->read_result();
-               return 0;
-       }
-#endif
-
-
 // Currently, CR2 is the only one which won't work asynchronously, so
 // we're not using a virtual function yet.
        if(!video_thread /* && asset->format != FILE_CR2 */)
@@ -1090,15 +768,6 @@ int File::start_video_decode_thread()
 
 int File::stop_audio_thread()
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               file_fork->send_command(FileFork::STOP_AUDIO_THREAD, 0, 0);
-               file_fork->read_result();
-               return 0;
-       }
-#endif
-
        if(audio_thread)
        {
                audio_thread->stop_writing();
@@ -1110,16 +779,6 @@ int File::stop_audio_thread()
 
 int File::stop_video_thread()
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::STOP_VIDEO_THREAD, 0, 0);
-               file_fork->read_result();
-               return 0;
-       }
-#endif
-
        if(video_thread)
        {
                video_thread->stop_reading();
@@ -1137,18 +796,6 @@ FileThread* File::get_video_thread()
 
 int File::set_channel(int channel) 
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-// Set it locally for get_channel
-               current_channel = channel;
-               file_fork->send_command(FileFork::SET_CHANNEL, (unsigned char*)&channel, sizeof(channel));
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        if(file && channel < asset->channels)
        {
                current_channel = channel;
@@ -1167,16 +814,6 @@ int File::get_channel()
 //  returns current program
 int File::set_program(int no)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_PROGRAM, (unsigned char*)&no, sizeof(no));
-               int result = file_fork->read_result();
-               current_program = no < 0 ? result : no;
-               return result;
-       }
-#endif
        int result = file ? file->set_program(no) : current_program;
        current_program = no < 0 ? result : no;
        return result;
@@ -1184,70 +821,21 @@ int File::set_program(int no)
 
 int File::get_cell_time(int no, double &time)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_CELL_TIME, (unsigned char*)&no, sizeof(no));
-               int result = file_fork->read_result();
-               time = *(double *)file_fork->result_data;
-               return result;
-       }
-#endif
-
        return file ? file->get_cell_time(no, time) : -1;
 }
 
 int File::get_system_time(int64_t &tm)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_STT_TIME, 0, 0);
-               int result = file_fork->read_result();
-               tm = *(int64_t *)file_fork->result_data;
-               return result;
-       }
-#endif
-
        return file ? file->get_system_time(tm) : -1;
 }
 
 int File::get_audio_for_video(int vstream, int astream, int64_t &channel_mask)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               unsigned char buffer[2*sizeof(int)];
-               int offset = 0;
-               *(int*)(buffer + offset) = vstream;
-               offset += sizeof(int);
-               *(int*)(buffer + offset) = astream;
-               file_fork->send_command(FileFork::GET_AUDIO4VIDEO, buffer, sizeof(buffer));
-               int result = file_fork->read_result();
-               channel_mask = *(int64_t *)file_fork->result_data;
-               return result;
-       }
-#endif
-
        return file ? file->get_audio_for_video(vstream, astream, channel_mask) : -1;
 }
 
 int File::get_video_pid(int track)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_VIDEO_PID,
-                               (unsigned char*)&track, sizeof(track));
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        return file ? file->get_video_pid(track) : -1;
 }
 
@@ -1256,67 +844,18 @@ int File::get_video_pid(int track)
 int File::get_video_info(int track, int &pid, double &framerate,
                int &width, int &height, char *title)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_VIDEO_INFO,
-                               (unsigned char*)&track, sizeof(track));
-               int result = file_fork->read_result();
-               if( !result ) {
-                       unsigned char *bp = file_fork->result_data;
-                       framerate = *(double*)bp;  bp += sizeof(framerate);
-                       pid       = *(int *)  bp;  bp += sizeof(pid);
-                       width     = *(int *)  bp;  bp += sizeof(width);
-                       height    = *(int *)  bp;  bp += sizeof(height);
-                       strcpy(title, (char *)bp);
-               }
-               return result;
-       }
-#endif
-
        return !file ? -1 :
                 file->get_video_info(track, pid, framerate, width, height, title);
 }
 
 int File::select_video_stream(Asset *asset, int vstream)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SELECT_VIDEO_STREAM,
-                               (unsigned char*)&vstream, sizeof(vstream));
-               int result = file_fork->read_result();
-               if( !result ) {
-                       unsigned char *bp = file_fork->result_data;
-                       asset->frame_rate    = *(double*)  bp;  bp += sizeof(asset->frame_rate);
-                       asset->video_length = *(int64_t *) bp;  bp += sizeof(asset->video_length);
-                       asset->width        = *(int *)     bp;  bp += sizeof(asset->width);
-                       asset->height       = *(int *)     bp;  bp += sizeof(asset->height);
-               }
-       }
-#endif
        return !file ? -1 :
                 file->select_video_stream(asset, vstream);
 }
 
 int File::select_audio_stream(Asset *asset, int astream)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SELECT_AUDIO_STREAM,
-                               (unsigned char*)&astream, sizeof(astream));
-               int result = file_fork->read_result();
-               if( !result ) {
-                       unsigned char *bp = file_fork->result_data;
-                       asset->audio_length = *(int64_t *) bp;  bp += sizeof(asset->audio_length);
-                       asset->sample_rate  = *(int *)     bp;  bp += sizeof(asset->sample_rate);
-               }
-       }
-#endif
        return !file ? -1 :
                 file->select_audio_stream(asset, astream);
 }
@@ -1341,18 +880,6 @@ int File::skim_video(int track, void *vp, skim_fn fn)
 
 int File::set_layer(int layer, int is_thread) 
 {
-#ifdef USE_FILEFORK
-// thread should only call in the fork
-       if(file_fork && !is_fork && !is_thread)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_LAYER, (unsigned char*)&layer, sizeof(layer));
-               int result = file_fork->read_result();
-               current_layer = layer;
-               return result;
-       }
-#endif
-
        if(file && layer < asset->layers)
        {
                if(!is_thread && video_thread)
@@ -1371,16 +898,6 @@ int File::set_layer(int layer, int is_thread)
 
 int64_t File::get_audio_length()
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_AUDIO_LENGTH, 0, 0);
-               int64_t result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        int64_t result = asset->audio_length;
        int64_t base_samplerate = -1;
        if(result > 0)
@@ -1396,17 +913,6 @@ int64_t File::get_audio_length()
 
 int64_t File::get_video_length()
 { 
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_VIDEO_LENGTH, 0, 0);
-               int64_t result = file_fork->read_result();
-               return result;
-       }
-#endif
-
-
        int64_t result = asset->video_length;
        float base_framerate = -1;
        if(result > 0)
@@ -1423,16 +929,6 @@ int64_t File::get_video_length()
 
 int64_t File::get_video_position() 
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_VIDEO_POSITION, 0, 0);
-               int64_t result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        float base_framerate = -1;
        if(base_framerate > 0)
                return (int64_t)((double)current_frame / asset->frame_rate * base_framerate + 0.5);
@@ -1442,17 +938,6 @@ int64_t File::get_video_position()
 
 int64_t File::get_audio_position() 
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_AUDIO_POSITION, 0, 0);
-               int64_t result = file_fork->read_result();
-               return result;
-       }
-#endif
-
-
 //     int64_t base_samplerate = -1;
 //     if(base_samplerate > 0)
 //     {
@@ -1472,18 +957,6 @@ int64_t File::get_audio_position()
 
 int File::set_audio_position(int64_t position) 
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::SET_AUDIO_POSITION, 
-                       (unsigned char*)&position, 
-                       sizeof(position));
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        int result = 0;
 
        if(!file) return 1;
@@ -1513,18 +986,6 @@ int File::set_audio_position(int64_t position)
 int File::set_video_position(int64_t position, 
        int is_thread) 
 {
-#ifdef USE_FILEFORK
-// Thread should only call in the fork
-       if(file_fork && !is_fork && !is_thread)
-       {
-               FileForker this_is(*forked);
-//printf("File::set_video_position %d %lld\n", __LINE__, position);
-               file_fork->send_command(FileFork::SET_VIDEO_POSITION, (unsigned char*)&position, sizeof(position));
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        int result = 0;
        if(!file) return 0;
 
@@ -1557,32 +1018,6 @@ int File::set_video_position(int64_t position,
 // No resampling here.
 int File::write_samples(Samples **buffer, int64_t len)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               int entry_size = Samples::filefork_size();
-               int buffer_size = entry_size * asset->channels + sizeof(int64_t);
-               unsigned char fork_buffer[buffer_size];
-               for(int i = 0; i < asset->channels; i++)
-               {
-                       buffer[i]->to_filefork(fork_buffer + entry_size * i);
-               }
-
-               *(int64_t*)(fork_buffer + 
-                       entry_size * asset->channels) = len;
-
-               file_fork->send_command(FileFork::WRITE_SAMPLES, 
-                       fork_buffer, 
-                       buffer_size);
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
-
-
-
        int result = 1;
 
        if(file)
@@ -1614,50 +1049,6 @@ int File::write_samples(Samples **buffer, int64_t len)
 int File::write_frames(VFrame ***frames, int len)
 {
 //printf("File::write_frames %d\n", __LINE__);
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-//printf("File::write_frames %d\n", __LINE__);
-               int entry_size = frames[0][0]->filefork_size();
-               unsigned char fork_buffer[entry_size * asset->layers * len + sizeof(int)];
-               for(int i = 0; i < asset->layers; i++)
-               {
-                       for(int j = 0; j < len; j++)
-                       {
-// printf("File::write_frames %d " _LD " %d\n", 
-// __LINE__, 
-// frames[i][j]->get_number(), 
-// frames[i][j]->get_keyframe());
-                               frames[i][j]->to_filefork(fork_buffer + 
-                                       sizeof(int) +
-                                       entry_size * len * i +
-                                       entry_size * j);
-                       }
-               }
-
-               
-//PRINT_TRACE
-// Frames per layer
-               int *fbfr = (int *)fork_buffer;
-               fbfr[0] = len;
-//PRINT_TRACE
-
-               file_fork->send_command(FileFork::WRITE_FRAMES, 
-                       fork_buffer, 
-                       sizeof(fork_buffer));
-//PRINT_TRACE
-               int result = file_fork->read_result();
-
-
-//printf("File::write_frames %d\n", __LINE__);
-               return result;
-       }
-
-
-#endif // USE_FILEFORK
-
-
 //PRINT_TRACE
 // Store the counters in temps so the filebase can choose to overwrite them.
        int result;
@@ -1692,16 +1083,6 @@ int File::write_compressed_frame(VFrame *buffer)
 
 int File::write_audio_buffer(int64_t len)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::WRITE_AUDIO_BUFFER, (unsigned char*)&len, sizeof(len));
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
        int result = 0;
        if(audio_thread)
        {
@@ -1712,53 +1093,6 @@ int File::write_audio_buffer(int64_t len)
 
 int File::write_video_buffer(int64_t len)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-// Copy over sequence numbers for background rendering
-// frame sizes for direct copy
-//printf("File::write_video_buffer %d\n", __LINE__);
-               int fork_buffer_size = sizeof(int64_t) +
-                       VFrame::filefork_size() * asset->layers * len;
-               unsigned char fork_buffer[fork_buffer_size];
-               int64_t *fbfr = (int64_t *)fork_buffer;
-               fbfr[0] = len;
-
-               for(int i = 0; i < asset->layers; i++)
-               {
-                       for(int j = 0; j < len; j++)
-                       {
-// Send memory state
-                               current_frame_buffer[i][j]->to_filefork(fork_buffer + 
-                                       sizeof(int64_t) +
-                                       VFrame::filefork_size() * (len * i + j));
-// printf("File::write_video_buffer %d size=%d %d %02x %02x %02x %02x %02x %02x %02x %02x\n", 
-// __LINE__, 
-// current_frame_buffer[i][j]->get_shmid(),
-// current_frame_buffer[i][j]->get_compressed_size(),
-// current_frame_buffer[i][j]->get_data()[0],
-// current_frame_buffer[i][j]->get_data()[1],
-// current_frame_buffer[i][j]->get_data()[2],
-// current_frame_buffer[i][j]->get_data()[3],
-// current_frame_buffer[i][j]->get_data()[4],
-// current_frame_buffer[i][j]->get_data()[5],
-// current_frame_buffer[i][j]->get_data()[6],
-// current_frame_buffer[i][j]->get_data()[7]);
-                       }
-               }
-
-//printf("File::write_video_buffer %d\n", __LINE__);
-               file_fork->send_command(FileFork::WRITE_VIDEO_BUFFER, 
-                       fork_buffer, 
-                       fork_buffer_size);
-//printf("File::write_video_buffer %d\n", __LINE__);
-               int result = file_fork->read_result();
-//printf("File::write_video_buffer %d\n", __LINE__);
-               return result;
-       }
-#endif
-
        int result = 0;
        if(video_thread)
        {
@@ -1770,84 +1104,12 @@ int File::write_video_buffer(int64_t len)
 
 Samples** File::get_audio_buffer()
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::GET_AUDIO_BUFFER, 0, 0);
-               int result = file_fork->read_result();
-
-// Read parameters for a Samples buffer & create it in File
-//             delete_temp_samples_buffer();
-//             if(!temp_samples_buffer) 
-//             {
-//                     temp_samples_buffer = new Samples**[ring_buffers];
-//                     for(int i = 0; i < ring_buffers; i++) temp_samples_buffer[i] = 0;
-//             }
-//             
-//             
-//             temp_samples_buffer  = new Samples*[asset->channels];
-//             for(int i = 0; i < asset->channels; i++)
-//             {
-//                     temp_samples_buffer[i] = new Samples;
-//                     temp_samples_buffer[i]->from_filefork(file_fork->result_data + 
-//                             i * Samples::filefork_size());
-//             }
-
-               return temp_samples_buffer[result];
-       }
-#endif
-
        if(audio_thread) return audio_thread->get_audio_buffer();
        return 0;
 }
 
 VFrame*** File::get_video_buffer()
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-
-               file_fork->send_command(FileFork::GET_VIDEO_BUFFER, 0, 0);
-               int result = file_fork->read_result();
-
-// Read parameters for a VFrame buffer & create it in File
-//             delete_temp_frame_buffer();
-
-
-//             temp_frame_size = *(int*)(file_fork->result_data + 
-//                     file_fork->result_bytes - 
-//                     sizeof(int));
-// 
-// //printf("File::get_video_buffer %d %p %d\n", __LINE__, this, asset->layers);
-//             temp_frame_buffer = new VFrame**[asset->layers];
-// 
-//             for(int i = 0; i < asset->layers; i++)
-//             {
-// 
-//                     temp_frame_buffer[i] = new VFrame*[temp_frame_size];
-// 
-//                     for(int j = 0; j < temp_frame_size; j++)
-//                     {
-// 
-//                             temp_frame_buffer[i][j] = new VFrame;
-// printf("File::get_video_buffer %d %p\n", __LINE__, temp_frame_buffer[i][j]);
-// 
-//                             temp_frame_buffer[i][j]->from_filefork(file_fork->result_data + 
-//                                     i * temp_frame_size * VFrame::filefork_size() +
-//                                     j * VFrame::filefork_size());
-// 
-//                     }
-//             }
-// 
-
-               current_frame_buffer = temp_frame_buffer[result];
-
-               return current_frame_buffer;
-       }
-#endif
-
        if(video_thread) 
        {
                VFrame*** result = video_thread->get_video_buffer();
@@ -1871,32 +1133,6 @@ int File::read_samples(Samples *samples, int64_t len)
        const int debug = 0;
        if(debug) PRINT_TRACE
 
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               int buffer_bytes = Samples::filefork_size() + sizeof(int64_t);
-               unsigned char buffer[buffer_bytes];
-               samples->to_filefork(buffer);
-               *(int64_t*)(buffer + Samples::filefork_size()) = len;
-               if(debug) PRINT_TRACE
-               file_fork->send_command(FileFork::READ_SAMPLES, 
-                       buffer, 
-                       buffer_bytes);
-               if(debug) PRINT_TRACE
-               int result = file_fork->read_result();
-
-// Crashed
-               if(result && !file_fork->child_running())
-               {
-                       delete file_fork;
-                       result = open_file(preferences, asset, rd, wr);
-               }
-
-               return result;
-       }
-#endif
-
        if(debug) PRINT_TRACE
 
        double *buffer = samples->get_data();
@@ -1928,59 +1164,6 @@ int File::read_frame(VFrame *frame, int is_thread)
 
        if(debug) PRINT_TRACE
 
-#ifdef USE_FILEFORK
-// is_thread is only true in the fork
-       if(file_fork && !is_fork && !is_thread)
-       {
-               FileForker this_is(*forked);
-               unsigned char fork_buffer[VFrame::filefork_size()];
-               if(debug) PRINT_TRACE
-
-               frame->to_filefork(fork_buffer);
-               file_fork->send_command(FileFork::READ_FRAME, 
-                       fork_buffer, 
-                       VFrame::filefork_size());
-
-               int result = file_fork->read_result();
-
-
-// Crashed
-               if(result && !file_fork->child_running())
-               {
-                       delete file_fork;
-                       result = open_file(preferences, asset, rd, wr);
-               }
-               else
-               if(!result && 
-                       frame->get_color_model() == BC_COMPRESSED)
-               {
-// Get compressed data from socket
-//printf("File::read_frame %d %d\n", __LINE__, file_fork->result_bytes);
-                       int header_size = sizeof(int) * 2;
-                       if(file_fork->result_bytes > header_size)
-                       {
-//printf("File::read_frame %d %d\n", __LINE__, file_fork->result_bytes);
-                               frame->allocate_compressed_data(file_fork->result_bytes - header_size);
-                               frame->set_compressed_size(file_fork->result_bytes - header_size);
-                               frame->set_keyframe(*(int*)(file_fork->result_data + sizeof(int)));
-                               memcpy(frame->get_data(), 
-                                       file_fork->result_data + header_size,
-                                       file_fork->result_bytes - header_size);
-                       }
-                       else
-// Get compressed data size
-                       {
-                               frame->set_compressed_size(*(int*)file_fork->result_data);
-                               frame->set_keyframe(*(int*)(file_fork->result_data + sizeof(int)));
-//printf("File::read_frame %d %d\n", __LINE__, *(int*)(file_fork->result_data + sizeof(int)));
-                       }
-               }
-
-               return result;
-       }
-#endif
-
-
 //printf("File::read_frame %d\n", __LINE__);
 
        if(video_thread && !is_thread) return video_thread->read_frame(frame);
@@ -1994,7 +1177,7 @@ int File::read_frame(VFrame *frame, int is_thread)
                int advance_position = 1;
 
 // Test cache
-               if(use_cache && !is_fork &&
+               if(use_cache &&
                        frame_cache->get_frame(frame,
                                current_frame,
                                current_layer,
@@ -2036,7 +1219,9 @@ int File::read_frame(VFrame *frame, int is_thread)
 
 //                     printf("File::read_frame %d\n", __LINE__);
                        temp_frame->copy_stacks(frame);
-                       file->read_frame(temp_frame);
+                       int result = file->read_frame(temp_frame);
+                       if( result && frame->get_status() > 0 )
+                               frame->set_status(-1);
 //for(int i = 0; i < 1000 * 1000; i++) ((float*)temp_frame->get_rows()[0])[i] = 1.0;
 // printf("File::read_frame %d %d %d %d %d %d\n", 
 // temp_frame->get_color_model(), 
@@ -2072,12 +1257,14 @@ int File::read_frame(VFrame *frame, int is_thread)
                {
 // Can't advance position here because it needs to be added to cache
 //printf("File::read_frame %d\n", __LINE__);
-                       file->read_frame(frame);
+                       int result = file->read_frame(frame);
+                       if( result && frame->get_status() > 0 )
+                               frame->set_status(-1);
 //for(int i = 0; i < 100 * 1000; i++) ((float*)frame->get_rows()[0])[i] = 1.0;
                }
 
 //printf("File::read_frame %d use_cache=%d\n", __LINE__, use_cache);
-               if(use_cache && !is_fork)
+               if(use_cache)
                        frame_cache->put_frame(frame,
                                current_frame, current_layer,
                                asset->frame_rate, 1, 0);
@@ -2098,39 +1285,6 @@ int File::can_copy_from(Asset *asset,
 {
        if(!asset) return 0;
 
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               FileXML xml;
-               asset->write(&xml, 1, "");
-               xml.terminate_string();
-               const char *xml_string = xml.string();
-               long xml_length = strlen(xml_string);
-               int buffer_size = xml_length + 1 + 
-                       sizeof(int64_t) +
-                       sizeof(int) + 
-                       sizeof(int);
-               unsigned char *buffer = new unsigned char[buffer_size];
-               *(int64_t*)(buffer) = position;
-               *(int*)(buffer + sizeof(int64_t)) = output_w;
-               *(int*)(buffer + sizeof(int64_t) + sizeof(int)) = output_h;
-               memcpy(buffer + 
-                       sizeof(int64_t) +
-                       sizeof(int) + 
-                       sizeof(int), 
-                       xml_string, 
-                       xml_length + 1);
-
-               file_fork->send_command(FileFork::CAN_COPY_FROM, 
-                       buffer, 
-                       buffer_size);
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
-
        if(file)
        {
                return asset->width == output_w &&
@@ -2174,12 +1328,6 @@ int File::strtoformat(ArrayList<PluginServer*> *plugindb, const char *format)
        if(!strcasecmp(format, _(VMPEG_NAME))) return FILE_VMPEG;
        if(!strcasecmp(format, _(TGA_NAME))) return FILE_TGA;
        if(!strcasecmp(format, _(TGA_LIST_NAME))) return FILE_TGA_LIST;
-       if(!strcasecmp(format, _(MOV_NAME))) return FILE_MOV;
-       if(!strcasecmp(format, _(AVI_NAME))) return FILE_AVI;
-       if(!strcasecmp(format, _(AVI_LAVTOOLS_NAME))) return FILE_AVI_LAVTOOLS;
-       if(!strcasecmp(format, _(AVI_ARNE2_NAME))) return FILE_AVI_ARNE2;
-       if(!strcasecmp(format, _(AVI_ARNE1_NAME))) return FILE_AVI_ARNE1;
-       if(!strcasecmp(format, _(AVI_AVIFILE_NAME))) return FILE_AVI_AVIFILE;
        if(!strcasecmp(format, _(OGG_NAME))) return FILE_OGG;
        if(!strcasecmp(format, _(VORBIS_NAME))) return FILE_VORBIS;
        if(!strcasecmp(format, _(RAWDV_NAME))) return FILE_RAWDV;
@@ -2222,19 +1370,13 @@ const char* File::formattostr(ArrayList<PluginServer*> *plugindb, int format)
                case FILE_TGA_LIST:     return _(TGA_LIST_NAME);
                case FILE_TIFF:         return _(TIFF_NAME);
                case FILE_TIFF_LIST:    return _(TIFF_LIST_NAME);
-               case FILE_MOV:          return _(MOV_NAME);
-               case FILE_AVI_LAVTOOLS: return _(AVI_LAVTOOLS_NAME);
-               case FILE_AVI:          return _(AVI_NAME);
-               case FILE_AVI_ARNE2:    return _(AVI_ARNE2_NAME);
-               case FILE_AVI_ARNE1:    return _(AVI_ARNE1_NAME);
-               case FILE_AVI_AVIFILE:  return _(AVI_AVIFILE_NAME);
                case FILE_OGG:          return _(OGG_NAME);
                case FILE_VORBIS:       return _(VORBIS_NAME);
                case FILE_RAWDV:        return _(RAWDV_NAME);
                case FILE_FFMPEG:       return _(FFMPEG_NAME);
                case FILE_DB:           return _(DBASE_NAME);
        }
-       return "Unknown";
+       return _("Unknown");
 }
 
 int File::strtobits(const char *bits)
@@ -2246,7 +1388,6 @@ int File::strtobits(const char *bits)
        if(!strcasecmp(bits, _(NAME_ULAW))) return BITSULAW;
        if(!strcasecmp(bits, _(NAME_ADPCM))) return BITS_ADPCM;
        if(!strcasecmp(bits, _(NAME_FLOAT))) return BITSFLOAT;
-       if(!strcasecmp(bits, _(NAME_IMA4))) return BITSIMA4;
        return BITSLINEAR16;
 }
 
@@ -2262,9 +1403,8 @@ const char* File::bitstostr(int bits)
                case BITSULAW:          return (NAME_ULAW);
                case BITS_ADPCM:        return (NAME_ADPCM);
                case BITSFLOAT:         return (NAME_FLOAT);
-               case BITSIMA4:          return (NAME_IMA4);
        }
-       return "Unknown";
+       return _("Unknown");
 }
 
 
@@ -2290,7 +1430,6 @@ int File::bytes_per_sample(int bits)
                case BITSLINEAR24:      return 3;
                case BITSLINEAR32:      return 4;
                case BITSULAW:          return 1;
-               case BITSIMA4:          return 1;
        }
        return 1;
 }
@@ -2309,8 +1448,6 @@ int File::get_best_colormodel(Asset *asset, int driver)
        switch(asset->format)
        {
                case FILE_RAWDV:        return FileDV::get_best_colormodel(asset, driver);
-               case FILE_MOV:          return FileMOV::get_best_colormodel(asset, driver);
-               case FILE_AVI:          return FileMOV::get_best_colormodel(asset, driver);
                case FILE_MPEG:         return FileMPEG::get_best_colormodel(asset, driver);
                case FILE_JPEG:
                case FILE_JPEG_LIST:    return FileJPEG::get_best_colormodel(asset, driver);
@@ -2331,23 +1468,6 @@ int File::get_best_colormodel(Asset *asset, int driver)
 
 int File::colormodel_supported(int colormodel)
 {
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               unsigned char buffer[sizeof(int)];
-               int *ibfr = (int *)buffer;
-               ibfr[0] = colormodel;
-
-               file_fork->send_command(FileFork::COLORMODEL_SUPPORTED, 
-                       buffer, 
-                       sizeof(int));
-               int result = file_fork->read_result();
-               return result;
-       }
-#endif
-
-
        if(file)
                return file->colormodel_supported(colormodel);
 
@@ -2364,15 +1484,6 @@ int64_t File::get_memory_usage()
 {
        int64_t result = 0;
 
-#ifdef USE_FILEFORK
-       if(file_fork)
-       {
-               FileForker this_is(*forked);
-               file_fork->send_command(FileFork::FILE_MEMORY_USAGE, 0, 0);
-               result = file_fork->read_result();
-       }
-       else
-#endif
        result += file_memory_usage();
        if(temp_frame) result += temp_frame->get_data_size();
        result += frame_cache->get_memory_usage();
@@ -2406,7 +1517,6 @@ int File::supports_video(int format)
        switch(format)
        {
                case FILE_OGG:
-               case FILE_MOV:
                case FILE_JPEG:
                case FILE_JPEG_LIST:
                case FILE_CR2:
@@ -2420,11 +1530,6 @@ int File::supports_video(int format)
                case FILE_TIFF:
                case FILE_TIFF_LIST:
                case FILE_VMPEG:
-               case FILE_AVI_LAVTOOLS:
-               case FILE_AVI_ARNE2:
-               case FILE_AVI:
-               case FILE_AVI_ARNE1:
-               case FILE_AVI_AVIFILE:
                case FILE_FFMPEG:
                case FILE_RAWDV:
                        return 1;
@@ -2440,18 +1545,12 @@ int File::supports_audio(int format)
                case FILE_FLAC:
                case FILE_PCM:
                case FILE_WAV:
-               case FILE_MOV:
                case FILE_OGG:
                case FILE_VORBIS:
                case FILE_AMPEG:
                case FILE_AU:
                case FILE_AIFF:
                case FILE_SND:
-               case FILE_AVI:
-               case FILE_AVI_LAVTOOLS:
-               case FILE_AVI_ARNE2:
-               case FILE_AVI_ARNE1:
-               case FILE_AVI_AVIFILE:
                case FILE_FFMPEG:
                        return 1;
        }
@@ -2466,7 +1565,6 @@ const char* File::get_tag(int format)
                case FILE_AIFF:         return "aif";
                case FILE_AMPEG:        return "mp3";
                case FILE_AU:           return "au";
-               case FILE_AVI:          return "avi";
                case FILE_RAWDV:        return "dv";
                case FILE_DB:           return "db";
                case FILE_EXR:          return "exr";
@@ -2474,7 +1572,6 @@ const char* File::get_tag(int format)
                case FILE_FLAC:         return "flac";
                case FILE_JPEG:         return "jpg";
                case FILE_JPEG_LIST:    return "jpg";
-               case FILE_MOV:          return "mov/mp4";
                case FILE_OGG:          return "ogg";
                case FILE_PCM:          return "pcm";
                case FILE_PNG:          return "png";
@@ -2486,7 +1583,7 @@ const char* File::get_tag(int format)
                case FILE_VMPEG:        return "m2v";
                case FILE_VORBIS:       return "ogg";
                case FILE_WAV:          return "wav";
-               case FILE_FFMPEG:       return "media";
+               case FILE_FFMPEG:       return "ffmpg";
        }
        return 0;
 }
@@ -2496,7 +1593,6 @@ const char* File::get_prefix(int format)
        switch(format) {
        case FILE_PCM:          return "PCM";
        case FILE_WAV:          return "WAV";
-       case FILE_MOV:          return "MOV";
        case FILE_PNG:          return "PNG";
        case FILE_JPEG:         return "JPEG";
        case FILE_TIFF:         return "TIFF";
@@ -2505,19 +1601,14 @@ const char* File::get_prefix(int format)
        case FILE_AU:           return "AU";
        case FILE_AIFF:         return "AIFF";
        case FILE_SND:          return "SND";
-       case FILE_AVI_LAVTOOLS: return "AVI_LAVTOOLS";
        case FILE_TGA_LIST:     return "TGA_LIST";
        case FILE_TGA:          return "TGA";
        case FILE_MPEG:         return "MPEG";
        case FILE_AMPEG:        return "AMPEG";
        case FILE_VMPEG:        return "VMPEG";
        case FILE_RAWDV:        return "RAWDV";
-       case FILE_AVI_ARNE2:    return "AVI_ARNE2";
-       case FILE_AVI_ARNE1:    return "AVI_ARNE1";
-       case FILE_AVI_AVIFILE:  return "AVI_AVIFILE";
        case FILE_TIFF_LIST:    return "TIFF_LIST";
        case FILE_PNG_LIST:     return "PNG_LIST";
-       case FILE_AVI:          return "AVI";
        case FILE_AC3:          return "AC3";
        case FILE_EXR:          return "EXR";
        case FILE_EXR_LIST:     return "EXR_LIST";
@@ -2531,7 +1622,7 @@ const char* File::get_prefix(int format)
        case FILE_GIF_LIST:     return "GIF_LIST";
        case FILE_DB:           return "DB";
        }
-       return "UNKNOWN";
+       return _("UNKNOWN");
 }
 
 
@@ -2558,3 +1649,16 @@ int File::record_fd()
 }
 
 
+void get_exe_path(char *result)
+{
+// Get executable path
+       int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
+       if( len >= 0 ) {
+               result[len] = 0;
+               char *ptr = strrchr(result, '/');
+               if( ptr ) *ptr = 0;
+       }
+       else
+               result[0] = 0;
+}
+