summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2012-05-31 12:38:27 (GMT)
committer Jaromil <jaromil@dyne.org>2012-05-31 12:38:27 (GMT)
commit3d8ded56fe806b4b17fb3a79ead5fedb07ceda1e (patch)
tree2dc23fe622da77a1efad8ce7c434de327a54ae9d
parent4a903f314b44a1d6be5048f4aed3ba39f055ac0a (diff)
fflush logging correctly and versioning
-rw-r--r--configure.ac2
-rw-r--r--scripts/S88hdsync13
-rw-r--r--src/hdsync_cli.cpp11
3 files changed, 20 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index c29ef27..79958ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl ==============================================================
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
-AC_INIT([HDSync],[1.0],[jaromil@dyne.org],[hdsync])
+AC_INIT([HDSync],[1.2],[jaromil@dyne.org],[hdsync])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
diff --git a/scripts/S88hdsync b/scripts/S88hdsync
index 158e33c..e6a6aaf 100644
--- a/scripts/S88hdsync
+++ b/scripts/S88hdsync
@@ -112,7 +112,8 @@ if [ -r /apps/ffmpeg/bin/ffmpeg ]; then
minutes=`expr $minutes \* 60`
seconds=`expr $seconds + $minutes`
seconds=`expr $seconds + $hours`
- echo "Video file length in seconds: $seconds"
+ seconds=`expr $seconds + 2`
+ echo "Video file length approximated in seconds: $seconds"
fi
cat <<EOF >> /tmp/hdsync.log
@@ -120,12 +121,14 @@ Launching hdsync for channel $HDSYNC_CHANNEL of $TOTAL_CHANNELS
Command:
-$APPROOT/bin/hdsync -p $UPNPPORT -s localhost \
- $HDSYNC_CHANNEL $TOTAL_CHANNELS \
+$APPROOT/bin/hdsync -p $UPNPPORT -s localhost -l $seconds
+ $HDSYNC_CHANNEL $TOTAL_CHANNELS
"$USBROOT/video/$file"
EOF
+sync
+
while true; do
# loop infinitely
@@ -133,13 +136,13 @@ while true; do
$APPROOT/bin/hdsync -p $UPNPPORT -s localhost -i eth0 \
$HDSYNC_CHANNEL $TOTAL_CHANNELS \
- "$USBROOT/video/$file" 2>&1 >> /tmp/hdsync.log
+ "$USBROOT/video/$file" >> /tmp/hdsync.log
else
$APPROOT/bin/hdsync -p $UPNPPORT -s localhost -i eth0 -l $seconds \
$HDSYNC_CHANNEL $TOTAL_CHANNELS \
- "$USBROOT/video/$file" 2>&1 >> /tmp/hdsync.log
+ "$USBROOT/video/$file" >> /tmp/hdsync.log
fi
diff --git a/src/hdsync_cli.cpp b/src/hdsync_cli.cpp
index db504a0..72e8771 100644
--- a/src/hdsync_cli.cpp
+++ b/src/hdsync_cli.cpp
@@ -232,6 +232,11 @@ int main(int argc, char **argv) {
exit(ERR);
}
+ printf("%s version %s distributed by Montevideo/NIMk\n"
+ "Copyright (C) 2011-2012 Jaromil @ Dyne.org, License GNU AGPL v3+\n"
+ "This is free software: you are free to change and redistribute it\n",
+ PACKAGE, VERSION);
+
printf("HDSync starting for channel %u of %u\n",chanID, chanTOT);
printf("will sync and play video: %s\n", filename);
@@ -376,6 +381,8 @@ int main(int argc, char **argv) {
connect_upnp(peers[0]);
render_upnp(peers[0],"Play","<Speed>1</Speed>");
+ fflush(NULL);
+
if(chanID==1) { // offer should send sync
zmq_sleep(2);
@@ -402,11 +409,15 @@ int main(int argc, char **argv) {
} // if(test|real)
+ fflush(NULL);
+
if(!videolen)
while( ! get_state("STOPPED") ) zmq_sleep(1);
else { // we know the videolen
printf("video length specified, waiting %u seconds then forcing loop\n",videolen);
+ fflush(NULL);
+
zmq_sleep(videolen);
// stop player twice, to fix the infamous 4h freeze