diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-12-23 23:30:57 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-01-01 15:05:52 +0100 |
commit | 24e37ddf57bac6a1c9786d50abbe3a1982930382 (patch) | |
tree | b34ae751986f185f51556a040f388025cac4c383 /rbutil/rbutilqt/base/autodetection.cpp | |
parent | 6803d7b10cd9651ded08674f1597d4511cabb7af (diff) | |
download | rockbox-24e37ddf57bac6a1c9786d50abbe3a1982930382.tar.gz rockbox-24e37ddf57bac6a1c9786d50abbe3a1982930382.zip |
ipodpatcher: move sectorbuf pointer into ipod_t structure.
The ipod_t structure holds all relevant information for ipodpatcher. Put the
global ipod_sectorbuf pointer into it as well. Allows the Rockbox Utility Ipod
class to be instanciated multiple times since each instance can now have its
own buffer.
Change-Id: Ie319cbadbc20c367ceadba9a46b4dc34b57a79a7
Diffstat (limited to 'rbutil/rbutilqt/base/autodetection.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/autodetection.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp index 0206502202..8fba1d8cea 100644 --- a/rbutil/rbutilqt/base/autodetection.cpp +++ b/rbutil/rbutilqt/base/autodetection.cpp | |||
@@ -137,9 +137,9 @@ bool Autodetection::detect() | |||
137 | int n; | 137 | int n; |
138 | // try ipodpatcher | 138 | // try ipodpatcher |
139 | // initialize sector buffer. Needed. | 139 | // initialize sector buffer. Needed. |
140 | ipod_sectorbuf = NULL; | ||
141 | ipod_alloc_buffer(&ipod_sectorbuf, BUFFER_SIZE); | ||
142 | struct ipod_t ipod; | 140 | struct ipod_t ipod; |
141 | ipod.sectorbuf = NULL; | ||
142 | ipod_alloc_buffer(&ipod, BUFFER_SIZE); | ||
143 | n = ipod_scan(&ipod); | 143 | n = ipod_scan(&ipod); |
144 | if(n == 1) { | 144 | if(n == 1) { |
145 | qDebug() << "[Autodetect] Ipod found:" << ipod.modelstr << "at" << ipod.diskname; | 145 | qDebug() << "[Autodetect] Ipod found:" << ipod.modelstr << "at" << ipod.diskname; |
@@ -162,8 +162,8 @@ bool Autodetection::detect() | |||
162 | else { | 162 | else { |
163 | qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n; | 163 | qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n; |
164 | } | 164 | } |
165 | free(ipod_sectorbuf); | 165 | free(ipod.sectorbuf); |
166 | ipod_sectorbuf = NULL; | 166 | ipod.sectorbuf = NULL; |
167 | 167 | ||
168 | // try sansapatcher | 168 | // try sansapatcher |
169 | // initialize sector buffer. Needed. | 169 | // initialize sector buffer. Needed. |