GNOME Bugzilla – Bug 635878
[qtmux] gst_qtmux_check_difference subtract 2 unsigned numbers without taking care of the result sign
Last modified: 2010-11-29 12:27:22 UTC
When 'gst_qtmux_check_difference' does the subtraction of the arguments it does not take care of the sign of the result, but since its arguments 'GstClockTime' is defined as an unsigned int: typedef guint64 GstClockTime; When the bigger number is subtracted from the smallest number, it will generate a 'negative' value but it will be read as positive, taking the 2's complement of the result, making the comparison always return TRUE. From traces: 0:00:01.899719239 3441 0x4d5fd0 ERROR qtmux ../../../gst/qtmux/gstqtmux.c:1553:gst_qtmux_check_difference:<mux> (a-b):18446744073705551616>=10000000 =TRUE 0:00:01.899749756 3441 0x4d5fd0 ERROR qtmux ../../../gst/qtmux/gstqtmux.c:1554:gst_qtmux_check_difference:<mux> (b-a):4000000>=10000000 =FALSE Regards, Alejandro
Do you have an specific input/file that triggers this?
Created attachment 175328 [details] [review] Patch for verifying order of operands in the subtraction This is a patch for verifying order of operands before doing the subtraction.
Regarding the (In reply to comment #1) > Do you have an specific input/file that triggers this? I'm using the next pipelines: gst-auto-launch \ qtmux name=mux mux.src ! \ filesink location=/home/ubuntu/MPEG4ENC_FUNCTIONAL_00001.mov \ omx_camera mode=1 vstab=false vnf=off exposure=1 awb=3 ldc=true zoom=200 focus=3 output-buffers=4 device=secondary name=cam \ cam.src ! \ "video/x-raw-yuv-strided, format=(fourcc)NV12, width=176, height=144, framerate=30/1, buffer-count-requested=4" ! \ queue name=q3 ! \ v4l2sink device=/dev/video2 min-queued-bufs=2 sync=false crop-top=0 crop-left=0 crop-width=176 crop-height=144 \ cam.vidsrc ! \ "video/x-raw-yuv-strided, format=(fourcc)NV12, width=176, height=144, framerate=30/1" ! \ queue name=q1 ! omx_mpeg4enc \ profile=1 level=level-2 input-buffers=2 output-buffers=2 bitrate=128000 ! \ queue name=q2 ! mux.video_0 \ pulsesrc ! amrnbenc ! queue ! mux.audio_0 0:play 20:eos or: gst-auto-launch qtmux name=mux mux.src ! filesink location=/home/ubuntu/L_SC.CAM2_00029_C.mov omx_camera mode=1 exposure=1 awb=3 ldc=true device=secondary output-buffers=4 name=cam cam.src ! "video/x-raw-yuv-strided, format=(fourcc)NV12, width=176, height=144, framerate=30/1, buffer-count-requested=4" ! tee name=t t. ! queue name=qenc_in ! omx_mpeg4enc profile=1 level=4 input-buffers=2 output-buffers=2 bitrate=4000000 ! queue name=qenc_out ! queue name=q_v_mux ! mux.video_0 t. ! queue name=q_v4l2 ! v4l2sink device=/dev/video2 min-queued-bufs=2 sync=false pulsesrc device=input ! audio/x-raw-int,rate=8000,channels=1,width=16 ! faac profile=2 ! queue ! mux.audio_0 0:play 20:eos But the real trigger of the issue is that the camera I am using is not giving me the 30 fps that I am asking for.
Pushed, thanks for the fix. commit 0930f0645f03f7bd59537bbb4550f62d5fe58a6a Author: Alejandro Gonzalez <agonzalez@dextratech.com> Date: Sat Nov 27 16:07:19 2010 -0600 qtmux: gst_qtmux_check_difference verify before subtract Avoid negative overflow by checking the order of operands on subtraction of unsigned integers. https://bugzilla.gnome.org/show_bug.cgi?id=635878