diff options
author | phintuka <phintuka> | 2007-05-18 15:49:02 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-05-18 15:49:02 +0000 |
commit | d14da03fd2310c42ba30f9ac09a540609e861e80 (patch) | |
tree | 65ba09986c9a1f4f01c6545e9848250ed5996996 | |
parent | aa0853dbce579892506bb9549be8c7eb1ed536fa (diff) | |
download | xineliboutput-d14da03fd2310c42ba30f9ac09a540609e861e80.tar.gz xineliboutput-d14da03fd2310c42ba30f9ac09a540609e861e80.tar.bz2 |
Call external script when aspect ratio changes
-rw-r--r-- | xine_fbfe_frontend.c | 3 | ||||
-rw-r--r-- | xine_frontend.c | 17 | ||||
-rw-r--r-- | xine_sxfe_frontend.c | 3 |
3 files changed, 20 insertions, 3 deletions
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c index 1e6697da..0316aaaf 100644 --- a/xine_fbfe_frontend.c +++ b/xine_fbfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_fbfe_frontend.c,v 1.16 2007-05-18 15:21:37 phintuka Exp $ + * $Id: xine_fbfe_frontend.c,v 1.17 2007-05-18 15:49:02 phintuka Exp $ * */ @@ -90,6 +90,7 @@ typedef struct fbfe_t { /* frontend */ double display_ratio; + double video_aspect; uint16_t xpos, ypos; uint16_t width, height; uint16_t video_width, video_height; diff --git a/xine_frontend.c b/xine_frontend.c index 785f15ef..d55de99c 100644 --- a/xine_frontend.c +++ b/xine_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_frontend.c,v 1.37 2007-05-18 15:09:42 phintuka Exp $ + * $Id: xine_frontend.c,v 1.38 2007-05-18 15:49:02 phintuka Exp $ * */ @@ -246,6 +246,21 @@ static void fe_frame_output_cb (void *data, if(this->cropping) xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, 100); } + + if(this->aspect_controller) { + double video_aspect = (video_pixel_aspect * (double)video_width / (double)video_height); + double aspect_diff = video_aspect - this->video_aspect; + if ((aspect_diff > 0.05) || (aspect_diff < -0.05)) { + char cmd[4096]; + if(snprintf(cmd, sizeof(cmd), "%s %d", + this->aspect_controller, (int)(video_aspect * 10000.0)) + < sizeof(cmd)) { + LOGDBG("Aspect ratio changed, executing %s", cmd); + system(cmd); + this->video_aspect = video_aspect; + } + } + } } static void xine_event_cb (void *user_data, const xine_event_t *event) diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 4b097591..e87112ef 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.24 2007-05-18 15:06:26 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.25 2007-05-18 15:49:02 phintuka Exp $ * */ @@ -125,6 +125,7 @@ typedef struct sxfe_s { /* frontend */ double display_ratio; + double video_aspect; char *aspect_controller; int xpos, ypos; uint16_t video_width, video_height; |