Author: tack
Date: Sun Apr  2 23:51:21 2006
New Revision: 1379

Modified:
   trunk/xine/src/drivers/video_out_kaa.c
   trunk/xine/src/drivers/x11.c

Log:
Remember last frame size values and use those values when callback is not
available (i.e. on shutdown).  Prevents video frame from shrinking to 50x50
when app exits.


Modified: trunk/xine/src/drivers/video_out_kaa.c
==============================================================================
--- trunk/xine/src/drivers/video_out_kaa.c      (original)
+++ trunk/xine/src/drivers/video_out_kaa.c      Sun Apr  2 23:51:21 2006
@@ -883,16 +883,6 @@
     kaa_driver_t *this = (kaa_driver_t *)this_gen;
     kaa_frame_t *frame = (kaa_frame_t *)frame_gen;
 
-    //printf("kaa_display_frame: %x draw=%x w=%d h=%d ratio=%.3f format=%d 
(yv12=%d yuy=%d)\n", frame, frame_gen->draw, frame->vo_frame.width, 
frame->height, frame->ratio, frame->format, XINE_IMGFMT_YV12, XINE_IMGFMT_YUY2);
-
-
-    /*
-    memcpy(frame->passthrough_frame->base[0], frame_gen->base[0], 
frame_gen->pitches[0] * frame->height);
-    memcpy(frame->passthrough_frame->base[1], frame_gen->base[1], 
frame_gen->pitches[1] * (frame->height>>1));
-    memcpy(frame->passthrough_frame->base[2], frame_gen->base[2], 
frame_gen->pitches[2] * (frame->height>>1));
-    */
-
-
     if (this->handle_frame_cb)
         this->handle_frame_cb(KAA_VO_HANDLE_FRAME_DISPLAY_PRE_OSD, frame_gen, 
&frame->user_data, this->handle_frame_cb_data);
 
@@ -901,6 +891,7 @@
 
     if (this->handle_frame_cb)
         this->handle_frame_cb(KAA_VO_HANDLE_FRAME_DISPLAY_POST_OSD, frame_gen, 
&frame->user_data, this->handle_frame_cb_data);
+
     if (frame->passthrough_frame->proc_slice) {
         // Serious kludge!  For passthrough drivers that do slices, we delay
         // processing them until now so that we have a chance to blend the 
@@ -915,15 +906,11 @@
         }
     }
 
-
     if (this->passthrough && this->do_passthrough) 
         this->passthrough->display_frame(this->passthrough, 
frame->passthrough_frame);
 
     this->last_frame = frame;
     frame->vo_frame.free(&frame->vo_frame);
-
-    pthread_mutex_unlock(&this->lock);
-
 }
 
 static int 

Modified: trunk/xine/src/drivers/x11.c
==============================================================================
--- trunk/xine/src/drivers/x11.c        (original)
+++ trunk/xine/src/drivers/x11.c        Sun Apr  2 23:51:21 2006
@@ -10,7 +10,9 @@
              *dest_size_callback;
     Display *display;
     PyObject *window_pyobject;
-    int close_display_needed;
+    int close_display_needed,
+        last_width, last_height;
+    double last_aspect;
 } x11_vo_user_data;
 
 
@@ -38,8 +40,12 @@
                 // FIXME: find a way to propagate this back to the main thread.
                 printf("EXCEPTION: frame_output_cb returned bad arguments 
(%s).\n", result->ob_type->tp_name);
                 PyErr_Print();
-            } else
+            } else {
                 success = 1;
+                user_data->last_width = *dest_width;
+                user_data->last_height = *dest_height;
+                user_data->last_aspect = *dest_pixel_aspect; 
+            }
             Py_DECREF(result);
         } else {
             // FIXME: find a way to propagate this back to the main thread.
@@ -52,10 +58,11 @@
 
     if (!success) {
         // Call to python space failed, but we need to set some sane defaults
-        // here, or else xine does ugly things.
+        // here, or else xine does ugly things.  So we'll use the last values.
         *dest_x = *dest_y = *win_x = *win_y = 0;
-        *dest_width = *dest_height = 50;
-        *dest_pixel_aspect = 1;
+        *dest_width = user_data->last_width;
+        *dest_height = user_data->last_height;
+        *dest_pixel_aspect = user_data->last_aspect;
     }
 }
 
@@ -83,8 +90,12 @@
                 // FIXME: find a way to propagate this back to the main thread.
                 printf("EXCEPTION: dest_size_cb returned bad arguments 
(%s).\n", result->ob_type->tp_name);
                 PyErr_Print();
-            } else
+            } else {
                 success = 1;
+                user_data->last_width = *dest_width;
+                user_data->last_height = *dest_height;
+                user_data->last_aspect = *dest_pixel_aspect; 
+            }
     
             Py_DECREF(result);
         } else {
@@ -97,9 +108,10 @@
 
     if (!success) {
         // Call to python space failed, but we need to set some sane defaults
-        // here, or else xine does ugly things.
-        *dest_width = *dest_height = 50;
-        *dest_pixel_aspect = 1;
+        // here, or else xine does ugly things.  So we'll use the last values.
+        *dest_width = user_data->last_width;
+        *dest_height = user_data->last_height;
+        *dest_pixel_aspect = user_data->last_aspect;
     }
 }
 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to