author | llornkcor <llornkcor> | 2004-09-18 11:42:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-18 11:42:01 (UTC) |
commit | d4e33108b974aa802f10d30a6a082adf67681224 (patch) (unidiff) | |
tree | 2c172af340d9bd4f7b85d4e42c33f8d190ef63f2 | |
parent | 35d96e2215c765da2270589c059c717a858333ca (diff) | |
download | opie-d4e33108b974aa802f10d30a6a082adf67681224.zip opie-d4e33108b974aa802f10d30a6a082adf67681224.tar.gz opie-d4e33108b974aa802f10d30a6a082adf67681224.tar.bz2 |
fix crash #1408
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index e851044..2396ed5 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp | |||
@@ -87,7 +87,6 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
87 | if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) | 87 | if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) |
88 | skinPath = "opieplayer2/skins/default"; | 88 | skinPath = "opieplayer2/skins/default"; |
89 | 89 | ||
90 | // odebug << "skin path " + skinPath << oendl; | ||
91 | 90 | ||
92 | // QString skinPath = "opieplayer2/skins/" + skin; | 91 | // QString skinPath = "opieplayer2/skins/" + skin; |
93 | 92 | ||
@@ -116,31 +115,28 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
116 | } | 115 | } |
117 | } | 116 | } |
118 | } | 117 | } |
119 | // odebug << "finished loading first pics" << oendl; | ||
120 | for ( int i = 0; i < 7; i++ ) { | 118 | for ( int i = 0; i < 7; i++ ) { |
121 | buttonPixUp[i] = NULL; | 119 | buttonPixUp[i] = NULL; |
122 | buttonPixDown[i] = NULL; | 120 | buttonPixDown[i] = NULL; |
123 | } | 121 | } |
124 | 122 | ||
125 | |||
126 | QWidget *d = QApplication::desktop(); | 123 | QWidget *d = QApplication::desktop(); |
127 | int width = d->width(); | 124 | int width = d->width(); |
128 | int height = d->height(); | 125 | int height = d->height(); |
129 | 126 | ||
130 | if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { | 127 | if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { |
131 | // odebug << "<<<<<<<< scale image >>>>>>>>>>>>" << oendl; | ||
132 | QImage img; | 128 | QImage img; |
133 | img = pixBg->convertToImage(); | 129 | img = pixBg->convertToImage(); |
134 | pixBg->convertFromImage( img.smoothScale( width, height)); | 130 | pixBg->convertFromImage( img.smoothScale( width, height)); |
135 | } | 131 | } |
136 | setBackgroundPixmap( *pixBg ); | ||
137 | 132 | ||
133 | setBackgroundPixmap( *pixBg ); | ||
138 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); | 134 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); |
139 | |||
140 | slider = new QSlider( Qt::Horizontal, this ); | 135 | slider = new QSlider( Qt::Horizontal, this ); |
141 | slider->setMinValue( 0 ); | 136 | slider->setMinValue( 0 ); |
142 | slider->setMaxValue( 1 ); | 137 | slider->setMaxValue( 1 ); |
143 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 138 | |
139 | slider->setBackgroundPixmap( *pixBg ); | ||
144 | slider->setFocusPolicy( QWidget::NoFocus ); | 140 | slider->setFocusPolicy( QWidget::NoFocus ); |
145 | // slider->setGeometry( QRect( 7, 250, 220, 20 ) ); | 141 | // slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |
146 | 142 | ||
@@ -158,8 +154,9 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
158 | setLength( mediaPlayerState->length() ); | 154 | setLength( mediaPlayerState->length() ); |
159 | setPosition( mediaPlayerState->position() ); | 155 | setPosition( mediaPlayerState->position() ); |
160 | setFullscreen( mediaPlayerState->fullscreen() ); | 156 | setFullscreen( mediaPlayerState->fullscreen() ); |
161 | // setPaused( mediaPlayerState->paused() ); | 157 | // setPlaying( mediaPlayerState->playing() ); |
162 | setPlaying( mediaPlayerState->playing() ); | 158 | // if(this->x() < 0 || this->y() < 0) |
159 | // this->move(0,0); | ||
163 | } | 160 | } |
164 | 161 | ||
165 | 162 | ||
@@ -472,6 +469,10 @@ bool VideoWidget::playVideo() { | |||
472 | int w = height(); | 469 | int w = height(); |
473 | int h = width(); | 470 | int h = width(); |
474 | 471 | ||
472 | QWidget *d = QApplication::desktop(); | ||
473 | int d_width = d->width(); | ||
474 | int d_height = d->height(); | ||
475 | |||
475 | ColorFormat format = (dd == 16) ? RGB565 : BGRA8888; | 476 | ColorFormat format = (dd == 16) ? RGB565 : BGRA8888; |
476 | 477 | ||
477 | if ( mediaPlayerState->fullscreen() ) | 478 | if ( mediaPlayerState->fullscreen() ) |
@@ -483,8 +484,8 @@ bool VideoWidget::playVideo() { | |||
483 | ( ( dd == 16 ) || ( dd == 32 ) ) && ( p.numRects() == 1 ) ) | 484 | ( ( dd == 16 ) || ( dd == 32 ) ) && ( p.numRects() == 1 ) ) |
484 | { | 485 | { |
485 | 486 | ||
486 | w = 320; | 487 | w = d_width; //320; |
487 | h = 240; | 488 | h = d_height; //240; |
488 | 489 | ||
489 | if ( mediaPlayerState->scaled() ) | 490 | if ( mediaPlayerState->scaled() ) |
490 | { | 491 | { |
@@ -525,9 +526,8 @@ bool VideoWidget::playVideo() { | |||
525 | { | 526 | { |
526 | #endif | 527 | #endif |
527 | QPainter p(this); | 528 | QPainter p(this); |
528 | 529 | w = d_width; //320; | |
529 | w = 320; | 530 | h = d_height; //240; |
530 | h = 240; | ||
531 | 531 | ||
532 | if ( mediaPlayerState->scaled() ) | 532 | if ( mediaPlayerState->scaled() ) |
533 | { | 533 | { |