# HG changeset patch # User reimar # Date 1158001280 0 # Node ID 0951c3e8864bccca9e9c6b03cc2c5421f11da473 # Parent 6c98f3566af1c279713bac13987d295a1b83ea6e Avoid division by zero DEMUXER_CTRL_GET_PERCENT_POS with only one frame by just returning DONTKNOW. A better formula to calculate position would probably be a better fix though. diff -r 6c98f3566af1 -r 0951c3e8864b libmpdemux/demux_mf.c --- a/libmpdemux/demux_mf.c Mon Sep 11 18:41:14 2006 +0000 +++ b/libmpdemux/demux_mf.c Mon Sep 11 19:01:20 2006 +0000 @@ -150,6 +150,8 @@ return DEMUXER_CTRL_OK; case DEMUXER_CTRL_GET_PERCENT_POS: + if (mf->nr_of_files <= 1) + return DEMUXER_CTRL_DONTKNOW; *((int *)arg) = 100 * mf->curr_frame / (mf->nr_of_files - 1); return DEMUXER_CTRL_OK;