aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-07-03 19:26:01 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-07-03 19:57:59 +0200
commit1128833ac03260534ba8fb0bb373cc5909a1946c (patch)
tree055fe6c6a7138b13afbfc55f4680b8aaecc00df5
parent35841bfe7a6aa6e12f39cccc8b3ad5c2664a53bf (diff)
downloadODR-AudioEnc-1128833ac03260534ba8fb0bb373cc5909a1946c.tar.gz
ODR-AudioEnc-1128833ac03260534ba8fb0bb373cc5909a1946c.tar.bz2
ODR-AudioEnc-1128833ac03260534ba8fb0bb373cc5909a1946c.zip
mot-encoder sorts slides in alphabetical order
-rw-r--r--src/mot-encoder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp
index d7a2509..97a6f20 100644
--- a/src/mot-encoder.cpp
+++ b/src/mot-encoder.cpp
@@ -32,6 +32,7 @@
#include <string>
#include <vector>
#include <deque>
+#include <list>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -89,6 +90,12 @@ struct slide_metadata_t {
// index, values from 0 to 9999, rolls over
int fidx;
+
+ // This is used to define the order in which several discovered
+ // slides are transmitted
+ bool operator<(const slide_metadata_t& other) const {
+ return this->filepath < other.filepath;
+ }
};
/*
typedef struct {
@@ -247,7 +254,7 @@ int main(int argc, char *argv[])
MagickWandGenesis();
- std::deque<slide_metadata_t> slides_to_transmit;
+ std::list<slide_metadata_t> slides_to_transmit;
fidx = 0;
while(1) {
@@ -279,7 +286,11 @@ int main(int argc, char *argv[])
}
}
- std::deque<slide_metadata_t>::iterator it;
+ // Sort the list in alphabetic order
+ slides_to_transmit.sort();
+
+ // Encode the slides
+ std::list<slide_metadata_t>::iterator it;
for (it = slides_to_transmit.begin();
it != slides_to_transmit.end();
++it) {