From 1fa61b697e6114ab5eae6fd2b9e5509dd6df38bc Mon Sep 17 00:00:00 2001 From: LarsAC Date: Sat, 8 Oct 2005 08:17:03 +0000 Subject: Only add pics to list of files that have been successfully converted git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@860 e10066b5-e1e2-0310-b819-94efdf66514b --- mg_image_provider.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mg_image_provider.c b/mg_image_provider.c index 1aeb9a6..cb60363 100644 --- a/mg_image_provider.c +++ b/mg_image_provider.c @@ -208,11 +208,14 @@ void mgImageProvider::Action() asprintf( &tmp, "image_convert.sh \"%s\" \"%s\"", filename.c_str(), tmpFile.c_str() ); system( (const char*) tmp ); free(tmp); - - // add to the list of converted images - Lock(); - m_converted_images.push_back( tmpFile ); - Unlock(); + + // if file can be read by process, add to the list of converted images + if( !access( tmpFile.c_str(), R_OK ) ) + { + Lock(); + m_converted_images.push_back( tmpFile ); + Unlock(); + } } // Check whether we need to continue this!? Next song may be playing already... -- cgit v1.2.3