]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_widgets.c
LGPL
[vlc] / src / video_output / video_widgets.c
index f4287f3ee36d16fc9215aac4b1a2b76943e83355..cdddac52a36907806c94252e8b32285c9bf71768 100644 (file)
@@ -1,25 +1,25 @@
 /*****************************************************************************
  * video_widgets.c : OSD widgets manipulation functions
  *****************************************************************************
- * Copyright (C) 2004-2010 the VideoLAN team
+ * Copyright (C) 2004-2010 VLC authors and VideoLAN
  * $Id$
  *
  * Author: Yoann Peronneau <yoann@videolan.org>
  *         Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -251,10 +251,11 @@ static int OSDWidgetValidate(subpicture_t *subpic,
                            bool has_dst_changed, const video_format_t *fmt_dst,
                            mtime_t ts)
 {
-    VLC_UNUSED(subpic); VLC_UNUSED(ts); VLC_UNUSED(fmt_src);
-    VLC_UNUSED(has_dst_changed); VLC_UNUSED(fmt_dst);
+    VLC_UNUSED(subpic); VLC_UNUSED(ts);
+    VLC_UNUSED(fmt_src); VLC_UNUSED(has_src_changed);
+    VLC_UNUSED(fmt_dst);
 
-    if (!has_src_changed && !has_dst_changed)
+    if (!has_dst_changed)
         return VLC_SUCCESS;
     return VLC_EGENERIC;
 }
@@ -265,7 +266,7 @@ static void OSDWidgetUpdate(subpicture_t *subpic,
                           mtime_t ts)
 {
     subpicture_updater_sys_t *sys = subpic->updater.p_sys;
-    VLC_UNUSED(fmt_dst); VLC_UNUSED(ts);
+    VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
 
     video_format_t fmt = *fmt_dst;
     fmt.i_width         = fmt.i_width         * fmt.i_sar_num / fmt.i_sar_den;
@@ -292,7 +293,7 @@ static void OSDWidget(vout_thread_t *vout, int channel, int type, int position)
     if (!var_InheritBool(vout, "osd"))
         return;
     if (type == OSD_HOR_SLIDER || type == OSD_VERT_SLIDER)
-        position = __MIN(__MAX(position, 0), 100);
+        position = VLC_CLIP(position, 0, 100);
 
     subpicture_updater_sys_t *sys = malloc(sizeof(*sys));
     if (!sys)