diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-25 22:27:48 +0000 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-25 22:27:48 +0000 |
commit | 465cdaaa8c8bbf51130418c8551042fc1902a17a (patch) | |
tree | 6876f4f99e7aeffe17f888a0cd3f440d755a7c10 /src | |
parent | de1134ac36b5e1d2ae8bdf2fbaa5c47e9f6091c9 (diff) | |
download | xine-lib-465cdaaa8c8bbf51130418c8551042fc1902a17a.tar.gz xine-lib-465cdaaa8c8bbf51130418c8551042fc1902a17a.tar.bz2 |
The frame_output_cb function for the scaler is mandatory, assert it so that debug builds will show the error.
When the build is non-debug, simply fallback to a certain, although not exactly desiderable, behaviour.
Identified by Coverity.
CVS patchset: 8276
CVS date: 2006/09/25 22:27:48
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/vo_scale.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index 075f9f28e..73ab7fcdd 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: vo_scale.c,v 1.37 2005/07/18 17:59:37 jstembridge Exp $ + * $Id: vo_scale.c,v 1.38 2006/09/25 22:27:48 dgp85 Exp $ * * Contains common code to calculate video scaling parameters. * In short, it will map frame dimensions to screen/window size. @@ -246,17 +246,20 @@ int _x_vo_scale_redraw_needed (vo_scale_t *this) { int gui_x, gui_y, gui_width, gui_height, gui_win_x, gui_win_y; double gui_pixel_aspect; int ret = 0; - - if( this->frame_output_cb ) { - this->frame_output_cb (this->user_data, - this->delivered_width - (this->crop_left + this->crop_right), - this->delivered_height - (this->crop_top + this->crop_bottom), - this->video_pixel_aspect, - &gui_x, &gui_y, &gui_width, &gui_height, - &gui_pixel_aspect, &gui_win_x, &gui_win_y ); - } else { - printf ("vo_scale: error! frame_output_cb must be set!\n"); + + assert(this->frame_output_cb); + if ( ! this->frame_output_cb ) { + /* TODO: Make this use xine_log, if xine instance is available. */ + fprintf(stderr, _("vo_scale: error! frame_output_cb must be set!\n")); + return 0; } + + this->frame_output_cb (this->user_data, + this->delivered_width - (this->crop_left + this->crop_right), + this->delivered_height - (this->crop_top + this->crop_bottom), + this->video_pixel_aspect, + &gui_x, &gui_y, &gui_width, &gui_height, + &gui_pixel_aspect, &gui_win_x, &gui_win_y ); if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) || (gui_width != this->gui_width) || (gui_height != this->gui_height) |