[MPlayer-users] [BUG] Floating point exception with mencoder mf://file

Giacomo Comes comes at naic.edu
Mon Sep 11 19:47:48 CEST 2006


This very simple mencoder command:

mencoder -ovc lavc -o test.avi mf://file.jpg -fps .1 -ofps 25

will abort with error: Floating point exception.

Digging around with svn, I did find that the bug were introduced in revision 19225.
The code is the following:

diff -Nraub 1/mplayer/libmpdemux/demux_mf.c 2/mplayer/libmpdemux/demux_mf.c
--- 1/mplayer/libmpdemux/demux_mf.c     2006-09-11 13:04:30.000000000 -0400
+++ 2/mplayer/libmpdemux/demux_mf.c     2006-09-11 12:48:12.000000000 -0400
@@ -140,6 +140,23 @@
   free(mf);
 }

+static int demux_control_mf(demuxer_t *demuxer, int cmd, void *arg) {
+  mf_t *mf = (mf_t *)demuxer->priv;
+  sh_video_t *sh_video = demuxer->video->sh;
+
+  switch(cmd) {
+    case DEMUXER_CTRL_GET_TIME_LENGTH:
+      *((double *)arg) = (double)mf->nr_of_files / sh_video->fps;
+      return DEMUXER_CTRL_OK;
+
+    case DEMUXER_CTRL_GET_PERCENT_POS:
+      *((int *)arg) = 100 * mf->curr_frame / (mf->nr_of_files - 1);
+      return DEMUXER_CTRL_OK;
+
+    default:
+      return DEMUXER_CTRL_NOTIMPL;
+  }
+}

 demuxer_desc_t demuxer_desc_mf = {
   "mf demuxer",
@@ -154,5 +171,5 @@
   demux_open_mf,
   demux_close_mf,
   demux_seek_mf,
-  NULL
+  demux_control_mf
 };

I think the problem is with the line:
    *((int *)arg) = 100 * mf->curr_frame / (mf->nr_of_files - 1);
because if I use mf://file1,file2 then there is no floating point exception.

It should be fixed for rc1.
Giacomo



More information about the MPlayer-users mailing list