Fixes any spelling or typos found in the comments
From: Erik Hovland <erik@hovland.org>
---
mythtv/programs/mythbackend/autoexpire.cpp | 26 +++++++++++++-------------
mythtv/programs/mythbackend/encoderlink.cpp | 6 +++---
mythtv/programs/mythbackend/main.cpp | 4 ++--
mythtv/programs/mythbackend/mainserver.cpp | 16 ++++++++--------
mythtv/programs/mythbackend/mythxml.cpp | 2 +-
mythtv/programs/mythbackend/scheduler.cpp | 2 +-
mythtv/programs/mythbackend/upnpcdsmusic.cpp | 2 +-
mythtv/programs/mythbackend/upnpcdstv.cpp | 2 +-
mythtv/programs/mythbackend/upnpcdsvideo.cpp | 2 +-
9 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/mythtv/programs/mythbackend/autoexpire.cpp b/mythtv/programs/mythbackend/autoexpire.cpp
index 13906f3..23f9763 100644
|
a
|
b
|
size_t AutoExpire::GetDesiredSpace(int fsID) const
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** \fn AutoExpire::CalcParams() |
| 120 | | * Calcualtes how much space needs to be cleared, and how often. |
| | 120 | * Calculates how much space needs to be cleared, and how often. |
| 121 | 121 | */ |
| 122 | 122 | void AutoExpire::CalcParams() |
| 123 | 123 | { |
| … |
… |
void AutoExpire::CalcParams()
|
| 145 | 145 | |
| 146 | 146 | // we use this copying on purpose. The used_encoders map ensures |
| 147 | 147 | // that every encoder writes only to one fs. |
| 148 | | // Copying the data minizes the time the lock is held |
| | 148 | // Copying the data minimizes the time the lock is held |
| 149 | 149 | instance_lock.lock(); |
| 150 | 150 | QMap<int, int>::const_iterator ueit = used_encoders.begin(); |
| 151 | 151 | while (ueit != used_encoders.end()) |
| … |
… |
void AutoExpire::CalcParams()
|
| 164 | 164 | fsMap[fsit->fsID] = 0; |
| 165 | 165 | size_t thisKBperMin = 0; |
| 166 | 166 | |
| 167 | | // append unkown recordings to all fsIDs |
| | 167 | // append unknown recordings to all fsIDs |
| 168 | 168 | vector<int>::iterator unknownfs_it = fsEncoderMap[-1].begin(); |
| 169 | 169 | for (; unknownfs_it != fsEncoderMap[-1].end(); ++unknownfs_it) |
| 170 | 170 | fsEncoderMap[fsit->fsID].push_back(*unknownfs_it); |
| … |
… |
void AutoExpire::CalcParams()
|
| 252 | 252 | * \brief This contains the main loop for the auto expire process. |
| 253 | 253 | * |
| 254 | 254 | * Responsible for cleanup of old LiveTV programs as well as deleting as |
| 255 | | * many expireable recordings as necessary to maintain enough free space |
| 256 | | * on all directories in MythTV Storage Groups. The thread deletes short |
| 257 | | * LiveTV programs every 2 minutes and long LiveTV and regular programs |
| 258 | | * as needed every "desired_freq" minutes. |
| | 255 | * many recordings that are eligible for expiration as necessary to |
| | 256 | * maintain enough free space on all directories in MythTV Storage Groups. |
| | 257 | * The thread deletes short LiveTV programs every 2 minutes and long |
| | 258 | * LiveTV and regular programs as needed every "desired_freq" minutes. |
| 259 | 259 | */ |
| 260 | 260 | void AutoExpire::RunExpirer(void) |
| 261 | 261 | { |
| … |
… |
void AutoExpire::RunExpirer(void)
|
| 271 | 271 | while (expire_thread_running) |
| 272 | 272 | { |
| 273 | 273 | curTime = QDateTime::currentDateTime(); |
| 274 | | // recalculate auto expire parametes |
| | 274 | // recalculate auto expire parameters |
| 275 | 275 | if (curTime >= next_expire) |
| 276 | 276 | CalcParams(); |
| 277 | 277 | |
| … |
… |
void AutoExpire::ExpireRecordings(void)
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | VERBOSE(VB_FILE, |
| 457 | | " Searching for expireable files in these directories"); |
| | 457 | " Searching for files eligible for expiration in these directories"); |
| 458 | 458 | QString myHostName = gContext->GetHostName(); |
| 459 | 459 | pginfolist_t::iterator it = expireList.begin(); |
| 460 | 460 | while ((it != expireList.end()) && |
| … |
… |
void AutoExpire::ExpireRecordings(void)
|
| 516 | 516 | fsit->freeSpaceKB += (p->filesize / 1024); |
| 517 | 517 | deleteList.push_back(p); |
| 518 | 518 | |
| 519 | | VERBOSE(VB_FILE, QString(" FOUND Expireable file. " |
| | 519 | VERBOSE(VB_FILE, QString(" FOUND file eligible for expiration. " |
| 520 | 520 | "%1 @ %2 is located at %3 which is on fsID #%4. " |
| 521 | 521 | "Adding to deleteList. After deleting we should " |
| 522 | 522 | "have %5 MB free on this filesystem.") |
| … |
… |
void AutoExpire::FillDBOrdered(pginfolist_t &expireList, int expMethod)
|
| 856 | 856 | { |
| 857 | 857 | default: |
| 858 | 858 | case emOldestFirst: |
| 859 | | msg = "Adding expirable programs in Oldest First order"; |
| | 859 | msg = "Adding programs eligible for expiration in Oldest First order"; |
| 860 | 860 | where = "autoexpire > 0"; |
| 861 | 861 | if (gContext->GetNumSetting("AutoExpireWatchedPriority", 0)) |
| 862 | 862 | orderby = "recorded.watched DESC, "; |
| 863 | 863 | orderby += "starttime ASC"; |
| 864 | 864 | break; |
| 865 | 865 | case emLowestPriorityFirst: |
| 866 | | msg = "Adding expirable programs in Lowest Priority First order"; |
| | 866 | msg = "Adding programs eligible for expiration in Lowest Priority First order"; |
| 867 | 867 | where = "autoexpire > 0"; |
| 868 | 868 | if (gContext->GetNumSetting("AutoExpireWatchedPriority", 0)) |
| 869 | 869 | orderby = "recorded.watched DESC, "; |
| 870 | 870 | orderby += "recorded.recpriority ASC, starttime ASC"; |
| 871 | 871 | break; |
| 872 | 872 | case emWeightedTimePriority: |
| 873 | | msg = "Adding expirable programs in Weighted Time Priority order"; |
| | 873 | msg = "Adding programs eligible for expiration in Weighted Time Priority order"; |
| 874 | 874 | where = "autoexpire > 0"; |
| 875 | 875 | if (gContext->GetNumSetting("AutoExpireWatchedPriority", 0)) |
| 876 | 876 | orderby = "recorded.watched DESC, "; |
diff --git a/mythtv/programs/mythbackend/encoderlink.cpp b/mythtv/programs/mythbackend/encoderlink.cpp
index b1b99fb..1786467 100644
|
a
|
b
|
using namespace std;
|
| 24 | 24 | * \class EncoderLink |
| 25 | 25 | * \brief Provides an interface to both local and remote TVRec's for the mythbackend. |
| 26 | 26 | * |
| 27 | | * This class be instanciated for either a local or remote TVRec's. |
| | 27 | * This class be instantiated for either a local or remote TVRec's. |
| 28 | 28 | * Many of the methods will work with either, but many only work for |
| 29 | 29 | * a local TVRec's and these are labeled appropriately in this document. |
| 30 | 30 | * |
| … |
… |
void EncoderLink::CancelNextRecording(bool cancel)
|
| 539 | 539 | * |
| 540 | 540 | * \param chain The LiveTV chain to use |
| 541 | 541 | * \param startchan The channel the LiveTV should start with |
| 542 | | * \param pip Tells TVRec's RingBuffer that this is for a Picture in Picture di |
| 543 | | splay. |
| | 542 | * \param pip Tells TVRec's RingBuffer that this is for a Picture in Picture |
| | 543 | * display. |
| 544 | 544 | * \sa TVRec::SpawnLiveTV(LiveTVChain*,bool,QString), |
| 545 | 545 | * RemoteEncoder::SpawnLiveTV(QString,bool,QString) |
| 546 | 546 | */ |
diff --git a/mythtv/programs/mythbackend/main.cpp b/mythtv/programs/mythbackend/main.cpp
index e2f4711..79254da 100644
|
a
|
b
|
int main(int argc, char **argv)
|
| 705 | 705 | (chanid.isEmpty() || starttime.isEmpty()) && infile.isEmpty()) |
| 706 | 706 | { |
| 707 | 707 | cerr << "--generate-preview must be accompanied by either " <<endl |
| 708 | | << "\nboth --chanid and --starttime paramaters, " << endl |
| 709 | | << "\nor the --infile paramater." << endl; |
| | 708 | << "\nboth --chanid and --starttime parameters, " << endl |
| | 709 | << "\nor the --infile parameter." << endl; |
| 710 | 710 | return BACKEND_EXIT_INVALID_CMDLINE; |
| 711 | 711 | } |
| 712 | 712 | |
diff --git a/mythtv/programs/mythbackend/mainserver.cpp b/mythtv/programs/mythbackend/mainserver.cpp
index 69a8b39..d4360cc 100644
|
a
|
b
|
void MainServer::ProcessRequestWork(MythSocket *sock)
|
| 608 | 608 | } |
| 609 | 609 | else |
| 610 | 610 | VERBOSE(VB_IMPORTANT, |
| 611 | | "WARNING: Recieved an empty SHUTDOWN_NOW query!"); |
| | 611 | "WARNING: Received an empty SHUTDOWN_NOW query!"); |
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | else if (command == "BACKEND_MESSAGE") |
| … |
… |
void *MainServer::SpawnDeleteThread(void *param)
|
| 1500 | 1500 | void MainServer::DoDeleteThread(const DeleteStruct *ds) |
| 1501 | 1501 | { |
| 1502 | 1502 | // sleep a little to let frontends reload the recordings list |
| 1503 | | // after deleteing a recording, then we can hammer the DB and filesystem |
| | 1503 | // after deleting a recording, then we can hammer the DB and filesystem |
| 1504 | 1504 | sleep(3); |
| 1505 | 1505 | usleep(rand()%2000); |
| 1506 | 1506 | |
| … |
… |
int MainServer::OpenAndUnlink(const QString &filename)
|
| 1803 | 1803 | * |
| 1804 | 1804 | * When the file is small enough this closes the file and returns. |
| 1805 | 1805 | * |
| 1806 | | * NOTE: This aquires a lock so that only one instance of TruncateAndClose() |
| | 1806 | * NOTE: This acquires a lock so that only one instance of TruncateAndClose() |
| 1807 | 1807 | * is running at a time. |
| 1808 | 1808 | */ |
| 1809 | 1809 | bool MainServer::TruncateAndClose(ProgramInfo *pginfo, int fd, |
| … |
… |
void MainServer::DoHandleDeleteRecording(ProgramInfo *pginfo, PlaybackSock *pbs,
|
| 2098 | 2098 | } |
| 2099 | 2099 | } |
| 2100 | 2100 | |
| 2101 | | // Tell all encoders to stop recordering to the file being deleted. |
| | 2101 | // Tell all encoders to stop recording to the file being deleted. |
| 2102 | 2102 | // Hopefully this is never triggered. |
| 2103 | 2103 | |
| 2104 | 2104 | QMap<int, EncoderLink *>::Iterator iter = encoderList->begin(); |
| … |
… |
void MainServer::HandleCommBreakQuery(const QString &chanid,
|
| 3487 | 3487 | { |
| 3488 | 3488 | // Commercial break query |
| 3489 | 3489 | // Format: QUERY_COMMBREAK <chanid> <starttime> |
| 3490 | | // chanid is chanid, starttime is startime of prorgram in |
| | 3490 | // chanid is chanid, starttime is startime of program in |
| 3491 | 3491 | // # of seconds since Jan 1, 1970, in UTC time. Same format as in |
| 3492 | 3492 | // a ProgramInfo structure in a string list. |
| 3493 | 3493 | // Return structure is [number of rows] followed by a triplet of values: |
| … |
… |
void MainServer::HandleCutlistQuery(const QString &chanid,
|
| 3502 | 3502 | { |
| 3503 | 3503 | // Cutlist query |
| 3504 | 3504 | // Format: QUERY_CUTLIST <chanid> <starttime> |
| 3505 | | // chanid is chanid, starttime is startime of prorgram in |
| | 3505 | // chanid is chanid, starttime is startime of program in |
| 3506 | 3506 | // # of seconds since Jan 1, 1970, in UTC time. Same format as in |
| 3507 | 3507 | // a ProgramInfo structure in a string list. |
| 3508 | 3508 | // Return structure is [number of rows] followed by a triplet of values: |
| … |
… |
void MainServer::HandleBookmarkQuery(const QString &chanid,
|
| 3517 | 3517 | PlaybackSock *pbs) |
| 3518 | 3518 | // Bookmark query |
| 3519 | 3519 | // Format: QUERY_BOOKMARK <chanid> <starttime> |
| 3520 | | // chanid is chanid, starttime is startime of prorgram in |
| | 3520 | // chanid is chanid, starttime is startime of program in |
| 3521 | 3521 | // # of seconds since Jan 1, 1970, in UTC time. Same format as in |
| 3522 | 3522 | // a ProgramInfo structure in a string list. |
| 3523 | 3523 | // Return value is a long-long encoded as two separate values |
| … |
… |
void MainServer::HandleSetBookmark(QStringList &tokens,
|
| 3549 | 3549 | { |
| 3550 | 3550 | // Bookmark query |
| 3551 | 3551 | // Format: SET_BOOKMARK <chanid> <starttime> <long part1> <long part2> |
| 3552 | | // chanid is chanid, starttime is startime of prorgram in |
| | 3552 | // chanid is chanid, starttime is startime of program in |
| 3553 | 3553 | // # of seconds since Jan 1, 1970, in UTC time. Same format as in |
| 3554 | 3554 | // a ProgramInfo structure in a string list. The two longs are the two |
| 3555 | 3555 | // portions of the bookmark value to set. |
diff --git a/mythtv/programs/mythbackend/mythxml.cpp b/mythtv/programs/mythbackend/mythxml.cpp
index 0108bf7..a1d2284 100644
|
a
|
b
|
void MythXML::GetProgramGuide( HTTPRequest *pRequest )
|
| 598 | 598 | |
| 599 | 599 | sCurChanId = pInfo->chanid; |
| 600 | 600 | |
| 601 | | // Ouput new Channel Node |
| | 601 | // Output new Channel Node |
| 602 | 602 | |
| 603 | 603 | channel = doc.createElement( "Channel" ); |
| 604 | 604 | channels.appendChild( channel ); |
diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
index 5233f0b..34d2aff 100644
|
a
|
b
|
void Scheduler::AddNewRecords(void)
|
| 2939 | 2939 | p->schedulerid = |
| 2940 | 2940 | p->startts.toString() + "_" + p->chanid; |
| 2941 | 2941 | |
| 2942 | | // Chedk to see if the program is currently recording and if |
| | 2942 | // Check to see if the program is currently recording and if |
| 2943 | 2943 | // the end time was changed. Ideally, checking for a new end |
| 2944 | 2944 | // time should be done after PruneOverlaps, but that would |
| 2945 | 2945 | // complicate the list handling. Do it here unless it becomes |
diff --git a/mythtv/programs/mythbackend/upnpcdsmusic.cpp b/mythtv/programs/mythbackend/upnpcdsmusic.cpp
index b954b07..389af4d 100644
|
a
|
b
|
|
| 1 | 1 | ////////////////////////////////////////////////////////////////////////////// |
| 2 | 2 | // Program Name: upnpcdsmusic.cpp |
| 3 | 3 | // |
| 4 | | // Purpose - uPnp Content Directory Extention for Music |
| | 4 | // Purpose - uPnp Content Directory Extension for Music |
| 5 | 5 | // |
| 6 | 6 | // Created By : David Blain Created On : Jan. 24, 2005 |
| 7 | 7 | // Modified By : Modified On: |
diff --git a/mythtv/programs/mythbackend/upnpcdstv.cpp b/mythtv/programs/mythbackend/upnpcdstv.cpp
index eede56f..1f42571 100644
|
a
|
b
|
|
| 1 | 1 | ////////////////////////////////////////////////////////////////////////////// |
| 2 | 2 | // Program Name: upnpcdstv.cpp |
| 3 | 3 | // |
| 4 | | // Purpose - uPnp Content Directory Extention for Recorded TV |
| | 4 | // Purpose - uPnp Content Directory Extension for Recorded TV |
| 5 | 5 | // |
| 6 | 6 | // Created By : David Blain Created On : Jan. 24, 2005 |
| 7 | 7 | // Modified By : Modified On: |
diff --git a/mythtv/programs/mythbackend/upnpcdsvideo.cpp b/mythtv/programs/mythbackend/upnpcdsvideo.cpp
index dfa7f73..b416d92 100644
|
a
|
b
|
|
| 1 | 1 | // Program Name: upnpcdsvideo.cpp |
| 2 | 2 | // |
| 3 | | // Purpose - uPnp Content Directory Extention for MythVideo Videos |
| | 3 | // Purpose - uPnp Content Directory Extension for MythVideo Videos |
| 4 | 4 | // |
| 5 | 5 | ////////////////////////////////////////////////////////////////////////////// |
| 6 | 6 | |