return r;
};
+int omnplay_library_relink_item(omnplay_instance_t* app, playlist_item_t* item)
+{
+ int r = 0;
+ playlist_item_t* lib;
+
+ pthread_mutex_lock(&app->library.lock);
+
+ lib = omnplay_library_find(app, item->id);
+
+ item->error = 0;
+
+ if(lib)
+ {
+ r = 1;
+ strcpy(item->title, lib->title);
+ item->dur = lib->dur;
+ item->in = lib->in;
+ }
+ else
+ {
+ r = 1;
+ item->error = PLAYLIST_ITEM_ERROR_LIB;
+ };
+
+ pthread_mutex_unlock(&app->library.lock);
+
+ return r;
+};
+
void omnplay_library_sort(omnplay_instance_t* app)
{
int i, j, m;
/* open and process file */
if((f = fopen(filename, "rt")))
{
- while( !feof(f) && c < (limit -1))
+ while(!feof(f) && c < limit)
{
char *s, *sp_r, *sp_b;
/* insert item */
items[c++] = item;
- };
+ }
+ else
+ g_warning("omnplay_library_load_file: ignored line [%s]\n", l);
}
fclose(f);
*pcount = c;
+ g_warning("omnplay_library_load_file: loaded [%d] items from [%s] file, limit [%d]\n", c, filename, limit);
+
return r;
};
frames2tc(item[i].in, 25.0, tc_in),
frames2tc(item[i].dur, 25.0, tc_dur),
item[i].title);
-
fclose(f);
+ g_warning("omnplay_library_save_file: written [%d] lines to file [%s]\n", count, filename);
};
};
static void omnplay_get_content_cb(omnplay_instance_t* app, playlist_item_t* item, void* data)
{
- omnplay_set_status(app, item->id);
+ if(!(app->library.id_display_idx % app->library.id_display_rate))
+ omnplay_set_status(app, item->id);
+ app->library.id_display_idx++;
};
static void* omnplay_library_refresh_proc(void* data)