From 24e37ddf57bac6a1c9786d50abbe3a1982930382 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 23 Dec 2012 23:30:57 +0100 Subject: 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 --- rbutil/rbutilqt/base/autodetection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rbutil/rbutilqt/base/autodetection.cpp') 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() int n; // try ipodpatcher // initialize sector buffer. Needed. - ipod_sectorbuf = NULL; - ipod_alloc_buffer(&ipod_sectorbuf, BUFFER_SIZE); struct ipod_t ipod; + ipod.sectorbuf = NULL; + ipod_alloc_buffer(&ipod, BUFFER_SIZE); n = ipod_scan(&ipod); if(n == 1) { qDebug() << "[Autodetect] Ipod found:" << ipod.modelstr << "at" << ipod.diskname; @@ -162,8 +162,8 @@ bool Autodetection::detect() else { qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n; } - free(ipod_sectorbuf); - ipod_sectorbuf = NULL; + free(ipod.sectorbuf); + ipod.sectorbuf = NULL; // try sansapatcher // initialize sector buffer. Needed. -- cgit v1.2.3