After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341542 - some users have an assertion failed: (GST_VIDEO_SINK_WIDTH (xvimagesink) > 0) when playing a theora video
some users have an assertion failed: (GST_VIDEO_SINK_WIDTH (xvimagesink) > 0)...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.6
Other Linux
: Normal blocker
: 0.10.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-12 14:04 UTC by Sebastien Bacher
Modified: 2006-05-26 09:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
fix (14.29 KB, patch)
2006-05-12 17:04 UTC, Jan Schmidt
committed Details | Review
additional fix (5.29 KB, patch)
2006-05-19 13:01 UTC, Jan Schmidt
committed Details | Review

Description Sebastien Bacher 2006-05-12 14:04:36 UTC
Debug log:

: tfheen@golem ~ > GST_DEBUG=xvimagesink:5 gst-launch-0.10 filesrc location=/home/tfheen/foo.ogg ! oggdemux ! theoradec ! ffmpegcolorspace ! xvimagesink
Setting pipeline to PAUSED ...
DEBUG (0x5098d0 - 0:00:00.192156000)          xvimagesink( 3133) xvimagesink.c(1332):gst_xvimagesink_xcontext_get:<xvimagesink0> X reports 1280x1024 pixels and 542 mm x 406 mm
DEBUG (0x5098d0 - 0:00:00.192320000)          xvimagesink( 3133) xvimagesink.c(1260):gst_xvimagesink_calculate_pixel_aspect_ratio: calculated pixel aspect ratio: 1,067980
DEBUG (0x5098d0 - 0:00:00.192458000)          xvimagesink( 3133) xvimagesink.c(1275):gst_xvimagesink_calculate_pixel_aspect_ratio: Decided on index 1 (16/15)
DEBUG (0x5098d0 - 0:00:00.192556000)          xvimagesink( 3133) xvimagesink.c(1283):gst_xvimagesink_calculate_pixel_aspect_ratio: set xcontext PAR to 16/15
DEBUG (0x5098d0 - 0:00:00.192777000)          xvimagesink( 3133) xvimagesink.c(1077):gst_xvimagesink_get_xv_support: Found 1 XV adaptor(s)
DEBUG (0x5098d0 - 0:00:00.192910000)          xvimagesink( 3133) xvimagesink.c(1094):gst_xvimagesink_get_xv_support: XV Adaptor ATI Radeon Video Overlay with 1 ports
DEBUG (0x5098d0 - 0:00:00.193326000)          xvimagesink( 3133) xvimagesink.c(1201):gst_xvimagesink_get_xv_support: Generated the following caps: video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)16711680, green_mask=(int)65280, red_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)16711680, green_mask=(int)65280, red_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)31744, green_mask=(int)992, red_mask=(int)31, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)63488, green_mask=(int)2016, red_mask=(int)31, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
DEBUG (0x5098d0 - 0:00:00.194227000)          xvimagesink( 3133) xvimagesink.c(399):gst_xvimagesink_check_xshm_calls: XvShmCreateImage of 1x1
DEBUG (0x5098d0 - 0:00:00.194543000)          xvimagesink( 3133) xvimagesink.c(1388):gst_xvimagesink_xcontext_get: xvimagesink is using XShm extension
DEBUG (0x5098d0 - 0:00:00.195117000)          xvimagesink( 3133) xvimagesink.c(1735):gst_xvimagesink_change_state:<xvimagesink0> set calculated PAR on object's PAR
DEBUG (0x5098d0 - 0:00:00.195232000)          xvimagesink( 3133) xvimagesink.c(1739):gst_xvimagesink_change_state:<xvimagesink0> XSynchronize called with FALSE
Pipeline is PREROLLING ...
DEBUG (0x73eee0 - 0:00:00.271032000)          xvimagesink( 3133) xvimagesink.c(1597):gst_xvimagesink_setcaps:<xvimagesink0> In setcaps. Possible caps video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)16711680, green_mask=(int)65280, red_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)16711680, green_mask=(int)65280, red_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)31744, green_mask=(int)992, red_mask=(int)31, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)24, bpp=(int)32, blue_mask=(int)63488, green_mask=(int)2016, red_mask=(int)31, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], setting caps video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)533333/500000, width=(int)360, height=(int)288
DEBUG (0x73eee0 - 0:00:00.271997000)          xvimagesink( 3133) xvimagesink.c(1601):gst_xvimagesink_setcaps:<xvimagesink0> intersection returned video/x-raw-yuv, format=(fourcc)I420, width=(int)360, height=(int)288, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)533333/500000
DEBUG (0x73eee0 - 0:00:00.272193000)          xvimagesink( 3133) xvimagesink.c(1659):gst_xvimagesink_setcaps:<xvimagesink0> video width/height: 360x288, calculated display ratio: 176871137/248870912
DEBUG (0x73eee0 - 0:00:00.272315000)          xvimagesink( 3133) xvimagesink.c(1676):gst_xvimagesink_setcaps:<xvimagesink0> approximating while keeping video height
DEBUG (0x73eee0 - 0:00:00.272429000)          xvimagesink( 3133) xvimagesink.c(1681):gst_xvimagesink_setcaps:<xvimagesink0> scaling to -2x288

** ERROR **: file xvimagesink.c: line 1689 (gst_xvimagesink_setcaps): assertion failed: (GST_VIDEO_SINK_WIDTH (xvimagesink) > 0)
aborting...
zsh: abort      GST_DEBUG=xvimagesink:5 gst-launch-0.10 filesrc location=/home/tfheen/foo.ogg
: tfheen@golem ~ >
Comment 1 Sebastien Bacher 2006-05-12 14:05:15 UTC
setting as blocked as asked by thaytan
Comment 2 Thomas Vander Stichele 2006-05-12 14:18:37 UTC
interesting, I was actually wondering when we would have the first overflow :)

Jan and I are working out fixes.

First thing to note is that the encoder probably made a rounding error; it's stored as 533333/500000 which is amazingly close to 16/15.

(Talking to myself)
I'm currently thinking we should have a function that can take a series of fractions and reduce their multiplication, noting overflow.  It should do its best to avoid overflows.  It could do this by ordering numerators and denominators, or splitting up in prime factors and crossing them off just like in school.

The function itself could take a valist of GstFraction, or a valist of num,den pairs, where either could be set to 1.
Comment 3 Jan Schmidt 2006-05-12 15:36:03 UTC
Here's a simple test case that reproduces the problem:

gst-launch videotestsrc ! video/x-raw-yuv,pixel-aspect-ratio='(fraction)'533333/500000,width=360,height=288 ! xvimagesink pixel-aspect-ratio=16/15

Attaching a patch shortly.
Comment 4 Jan Schmidt 2006-05-12 17:04:17 UTC
Created attachment 65333 [details] [review]
fix

This fixes the bug in xvimagesink, as well as the same problem in videoscale
Comment 5 Jan Schmidt 2006-05-12 21:29:31 UTC
Fixed in CVS:
        * docs/libs/gst-plugins-base-libs-docs.sgml:
        * docs/libs/gst-plugins-base-libs-sections.txt:
        * gst-libs/gst/video/video.c: (gst_video_calculate_display_ratio):
        * gst-libs/gst/video/video.h:
        * gst/videoscale/Makefile.am:
        * gst/videoscale/gstvideoscale.c: (gst_video_scale_fixate_caps):
        * sys/xvimage/xvimagesink.c: (gst_xvimagesink_setcaps):
        * tests/check/Makefile.am:
        * tests/check/libs/video.c: (GST_START_TEST), (video_suite),
        (main):
          Fix integer overflow problem with pixel-aspect-ratio calculations
          in videoscale and xvimagesink (#341542)
Comment 6 Jan Schmidt 2006-05-19 12:56:07 UTC
Apparently this isn't completely fixed for all users:

gst-launch videotestsrc ! video/x-raw-yuv,width=360,height=288,pixel-aspect-ratio=533333/500000 ! xvimagesink pixel-aspect-ratio=54/59

still results in an overflow when choosing the scaled width and height.

Attaching patch.
Comment 7 Jan Schmidt 2006-05-19 13:01:16 UTC
Created attachment 65830 [details] [review]
additional fix

This patch makes xvimagesink and videoscale use the gstutils scaling function for calculating the scaled width/height of the video, avoiding 32-bit overflow
in the multiplication.
Comment 8 Sebastien Bacher 2006-05-19 14:10:14 UTC
CVS fix works great, that you, I'll upload that to dapper
Comment 9 Wim Taymans 2006-05-25 17:05:49 UTC
ok, closing.