aboutsummaryrefslogtreecommitdiff
path: root/lib/service/servicedvb.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-05-15 23:58:14 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-05-15 23:58:14 +0000
commit7f388f37e91a395eb5d40292eb98725592bb2956 (patch)
treec1d92376a72be4137f5ef74bf75e2015f45bcfcc /lib/service/servicedvb.cpp
parent14490ab8fe9c3eeb2e9f40da4b2e70f519357e63 (diff)
downloadenigma2-7f388f37e91a395eb5d40292eb98725592bb2956.tar.gz
enigma2-7f388f37e91a395eb5d40292eb98725592bb2956.zip
ouch. don't try to devide by zero when length is 0 / not available.
Diffstat (limited to 'lib/service/servicedvb.cpp')
-rw-r--r--lib/service/servicedvb.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp
index 60aeb9fe..173f471b 100644
--- a/lib/service/servicedvb.cpp
+++ b/lib/service/servicedvb.cpp
@@ -1177,12 +1177,15 @@ RESULT eDVBServicePlay::stop()
if (getLength(length))
length = 0;
-
- int perc = play_position * 100LL / length;
- /* only store last play position when between 5% and 95% */
- if ((5 < perc) && (perc < 95))
- m_cue_entries.insert(cueEntry(play_position, 3)); /* last play position */
+ if (length)
+ {
+ int perc = play_position * 100LL / length;
+
+ /* only store last play position when between 5% and 95% */
+ if ((5 < perc) && (perc < 95))
+ m_cue_entries.insert(cueEntry(play_position, 3)); /* last play position */
+ }
m_cuesheet_changed = 1;
}
}