From 5646090398b786b11cce5e70276bdd16695eccd2 Mon Sep 17 00:00:00 2001 From: Luigi Yucheng LIU Date: Tue, 26 Aug 2014 00:06:57 +0800 Subject: Update mot-encoder.cpp --- src/mot-encoder.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mot-encoder.cpp') diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp index 9eb28b8..e2dae36 100644 --- a/src/mot-encoder.cpp +++ b/src/mot-encoder.cpp @@ -279,9 +279,9 @@ int main(int argc, char *argv[]) fprintf(stderr, "mot-encoder Error: cannot open directory '%s'\n", dir); return 1; } - if (fidx == MAXSLIDEID) { - fidx = 0; - transmission_history.clear(); + + if (transmission_history.size() >= MAXSLIDEID) { + transmission_history.clear(); } // Add new slides to transmit to list @@ -303,7 +303,12 @@ int main(int argc, char *argv[]) // update transmission history transmission_history[pDirent->d_name] = md.fidx; - fidx++; + + if (fidx == MAXSLIDEID) { + fidx = 0; + else { + fidx++; + } } slides_to_transmit.push_back(md); -- cgit v1.2.3