From ce054c9ba3baaa04d9033e2af05a1cfcd1f60fee Mon Sep 17 00:00:00 2001 From: "N.N." Date: Wed, 15 Jul 2009 01:35:57 +0000 Subject: format list upgrade svn path=/trunk/externals/pdvjtools/; revision=11868 --- videogrid/videogrid.cc | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/videogrid/videogrid.cc b/videogrid/videogrid.cc index 70f4013..6ff9c4f 100644 --- a/videogrid/videogrid.cc +++ b/videogrid/videogrid.cc @@ -681,14 +681,16 @@ extern "C" /* FFMPEG o Quicktime per les conversions */ int fferror=0; int nN = x->x_ultima_img; + /* if (format_adequat_v(entrada, x->x_format_list) == 0) { - /* ara no entra: format_adequat_v = 0 sempre */ - /* convertir_img(entrada,FORMAT_MINIATURA, x->x_w_cell, x->x_h_cell, nN); */ - fferror = 0; + + // convertir_img(entrada,FORMAT_MINIATURA, x->x_w_cell, x->x_h_cell, nN); + fferror = -1; } else { - fferror=convertir_img_ff(entrada,FORMAT_MINIATURA, x->x_w_cell, x->x_h_cell, nN); - } + */ + fferror=convertir_img_ff(entrada,FORMAT_MINIATURA, x->x_w_cell, x->x_h_cell, nN); + /* } */ /* post ("%d",fferror); */ if (fferror>=0) { /* encua el nou node */ @@ -767,7 +769,6 @@ extern "C" strcat(ig_path,"."); strcat(ig_path,FORMAT_MINIATURA); /* post("reestablint la imatge %s", actual->pathFitxer); */ - // videogrid_afegir_imatge(x,actual->pathFitxer); convertir_img_ff(actual->pathFitxer,FORMAT_MINIATURA, x->x_w_cell, x->x_h_cell, nN); sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path); sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n", @@ -1213,7 +1214,9 @@ extern "C" post("Videogrid: Problem opening file %s.\n",e); } else { - videogrid_afegir_imatge(x,e); + if (format_adequat_v(e, x->x_format_list) != 0) { + videogrid_afegir_imatge(x,e); + } } } @@ -1254,13 +1257,15 @@ extern "C" strcpy(pathActual,x->x_dir_actual); strcat(pathActual,"/"); strcat(pathActual,nomImatge); - pthread_mutex_lock(&x->x_lock); - videogrid_afegir_imatge(x, pathActual); - pthread_mutex_unlock(&x->x_lock); - /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */ - numEncuats++; - /* es desa la posició en el directori de l'últim node encuat */ - x->x_dir_pos = numPosDir; + if (format_adequat_v(pathActual, x->x_format_list) != 0) { + pthread_mutex_lock(&x->x_lock); + videogrid_afegir_imatge(x, pathActual); + pthread_mutex_unlock(&x->x_lock); + /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */ + numEncuats++; + } + /* es desa la posició en el directori de l'últim node encuat */ + x->x_dir_pos = numPosDir; } } } @@ -1281,13 +1286,15 @@ extern "C" strcpy(pathActual,x->x_dir_actual); strcat(pathActual,"/"); strcat(pathActual,nomImatge); - pthread_mutex_lock(&x->x_lock); - videogrid_afegir_imatge(x, pathActual); - pthread_mutex_unlock(&x->x_lock); - /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */ - numEncuats++; - /* es desa la posició en el directori de l'últim node encuat */ - x->x_dir_pos = numPosDir; + if (format_adequat_v(pathActual, x->x_format_list) != 0) { + pthread_mutex_lock(&x->x_lock); + videogrid_afegir_imatge(x, pathActual); + pthread_mutex_unlock(&x->x_lock); + /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */ + numEncuats++; + } + /* es desa la posició en el directori de l'últim node encuat */ + x->x_dir_pos = numPosDir; } } } -- cgit v1.2.1