Mercurial > hg > svcore
comparison data/fileio/MP3FileReader.cpp @ 980:6e6da0636e5e tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 16:36:21 +0100 |
parents | 048173126e71 |
children | cc27f35aa75c |
comparison
equal
deleted
inserted
replaced
954:35b05cac32d0 | 980:6e6da0636e5e |
---|---|
61 return; | 61 return; |
62 } | 62 } |
63 | 63 |
64 m_fileSize = stat.st_size; | 64 m_fileSize = stat.st_size; |
65 | 65 |
66 m_filebuffer = 0; | |
67 m_samplebuffer = 0; | |
68 m_samplebuffersize = 0; | |
69 | |
66 int fd = -1; | 70 int fd = -1; |
67 if ((fd = ::open(m_path.toLocal8Bit().data(), O_RDONLY | 71 if ((fd = ::open(m_path.toLocal8Bit().data(), O_RDONLY |
68 #ifdef _WIN32 | 72 #ifdef _WIN32 |
69 | O_BINARY | 73 | O_BINARY |
70 #endif | 74 #endif |
71 , 0)) < 0) { | 75 , 0)) < 0) { |
72 m_error = QString("Failed to open file %1 for reading.").arg(m_path); | 76 m_error = QString("Failed to open file %1 for reading.").arg(m_path); |
73 return; | 77 return; |
74 } | 78 } |
75 | |
76 m_filebuffer = 0; | |
77 m_samplebuffer = 0; | |
78 m_samplebuffersize = 0; | |
79 | 79 |
80 try { | 80 try { |
81 m_filebuffer = new unsigned char[m_fileSize]; | 81 m_filebuffer = new unsigned char[m_fileSize]; |
82 } catch (...) { | 82 } catch (...) { |
83 m_error = QString("Out of memory"); | 83 m_error = QString("Out of memory"); |