X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffilelist.C;h=3443a8b408575d867c0442efeab8ded57ccd1df3;hb=6c6367a007ab0f67538ad165e5815e66183a3997;hp=d04ee5ab30d08e7d8431546ab40bf5bc9a571dfc;hpb=47f71d004db08fb289428240fb87ce97c64382d2;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/filelist.C b/cinelerra-5.1/cinelerra/filelist.C index d04ee5ab..3443a8b4 100644 --- a/cinelerra-5.1/cinelerra/filelist.C +++ b/cinelerra-5.1/cinelerra/filelist.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * 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 @@ -112,39 +113,41 @@ int FileList::open_file(int rd, int wr) //printf("FileList::open_file %d asset->path=%s\n", __LINE__, asset->path); if(stream) { + int width = asset->width, height = asset->height; char string[BCTEXTLEN]; - (void)fread(string, strlen(list_prefix), 1, stream); + int len = strlen(list_prefix); + int ret = fread(string, 1, len, stream); fclose(stream); - - if(!strncasecmp(string, list_prefix, strlen(list_prefix))) - { - -//printf("FileList::open_file %d\n", __LINE__); + result = len == ret ? 0 : 1; + if( !result && !strncasecmp(string, list_prefix, len)) { asset->format = list_type; - -// Open index here or get frame size from file. result = read_list_header(); -//printf("FileList::open_file %d %s\n", __LINE__, path_list.values[0]); - if(!result) result = read_frame_header(path_list.values[0]); + if( !result ) + result = read_frame_header(path_list.values[0]); } - else - { -//printf("FileList::open_file 2\n", asset->use_header); -//printf("FileList::open_file %d\n", __LINE__); + else if( !result && frame_type != FILE_UNKNOWN ) { asset->format = frame_type; - int width = asset->width; - int height = asset->height; result = read_frame_header(asset->path); - asset->actual_width = asset->width; - if( width ) asset->width = width; - asset->actual_height = asset->height; - if( height ) asset->height = height; + asset->video_length = -1; + } + else + result = 1; + if( !result ) { + asset->actual_width = asset->width; + asset->actual_height = asset->height; + int scale = asset->proxy_scale; + if( scale ) { + asset->width = asset->actual_width * scale; + asset->height = asset->actual_height * scale; + } + else { // can_scale_input + if( width ) asset->width = width; + if( height ) asset->height = height; + } asset->layers = 1; if( !asset->frame_rate ) - asset->frame_rate = 1; - asset->video_length = -1; + asset->frame_rate = 10; } - result = 0; } else eprintf(_("Error while opening \"%s\" for reading. \n%m\n"), asset->path);