Previous 199869 Revisions Next

r23843 Friday 21st June, 2013 at 17:24:41 UTC by Oliver Stöneberg
chdman: fixed hang when chd_file_compressor::async_read() failed (e.g. trying to read an .avi with unsupported color depth) / improved error reporting a bit (nw)
[src/lib/util]chd.c
[src/tools]chdman.c

trunk/src/tools/chdman.c
r23842r23843
28882888         {
28892889            return err.error();
28902890         }
2891         catch (std::bad_alloc &)
2891         catch (std::exception& ex)
28922892         {
2893            fprintf(stderr, "Out of memory\n");
2893            fprintf(stderr, "Unhandled exception: %s\n", ex.what());
28942894            return 1;
28952895         }
2896         catch (...)
2897         {
2898            fprintf(stderr, "Unhandled exception\n");
2899            return 1;
2900         }
29012896      }
29022897
29032898   // print generic help if nothing found
trunk/src/lib/util/chd.c
r23842r23843
24222422
24232423chd_error chd_file_compressor::compress_continue(double &progress, double &ratio)
24242424{
2425   // if we got an error, return an error
2426   if (m_read_error)
2427      return CHDERR_READ_ERROR;
2428
24252429   // if done reading, queue some more
24262430   while (m_read_queue_offset < m_logicalbytes && osd_work_queue_items(m_read_queue) < 2)
24272431   {
2428      // if we got an error, return an error
2429      if (m_read_error)
2430         return CHDERR_READ_ERROR;
2431
24322432      // see if we have enough free work items to read the next half of a buffer
24332433      UINT32 startitem = m_read_queue_offset / hunk_bytes();
24342434      UINT32 enditem = startitem + WORK_BUFFER_HUNKS / 2;
r23842r23843
26902690      // advance the read pointer
26912691      m_read_done_offset += numbytes;
26922692   }
2693   catch (...)
2693   catch (std::exception& ex)
26942694   {
2695      fprintf(stderr, "exception occured: %s\n", ex.what());
26952696      m_read_error = true;
26962697   }
26972698}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team