summaryrefslogtreecommitdiff
path: root/src/multiplexer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/multiplexer.cc')
-rw-r--r--src/multiplexer.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/multiplexer.cc b/src/multiplexer.cc
index 0021c03..7a8b095 100644
--- a/src/multiplexer.cc
+++ b/src/multiplexer.cc
@@ -301,13 +301,22 @@ bool Multiplexer::packet()
//info->info("\t\tWritten[A]: %f, Written[V]: %f", written[TYPE_AUDIO], written[TYPE_VIDEO]);
StreamType type;
-
+ /*
// New switching mechanism
- if(written[TYPE_AUDIO] < written[TYPE_VIDEO] + 10) {
+ if(written[TYPE_AUDIO] < written[TYPE_VIDEO]) {
type = TYPE_AUDIO;
} else {
type = TYPE_VIDEO;
}
+ */
+
+ // Newer switching mechanism
+ if(queue[TYPE_AUDIO]->size() > queue[TYPE_VIDEO]->size()) {
+ type = TYPE_AUDIO;
+ } else {
+ type = TYPE_VIDEO;
+ }
+
if(!packet(type)) {
// Flush the other stream too...