[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#526639: marked as done (tvtime: Save matte setting in config file + matte tweaks)



Your message dated Thu, 26 Jan 2017 12:50:01 +0000
with message-id <E1cWjV3-000Gmw-OF@fasolo.debian.org>
and subject line Bug#526639: fixed in tvtime 1.0.11-1
has caused the Debian Bug report #526639,
regarding tvtime: Save matte setting in config file + matte tweaks
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
526639: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526639
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: tvtime
Version: 1.0.2-2~lg50+1
Severity: normal
Tags: patch

Hello,

I noticed a problem with the matte setting. The setting is not written to
config file and not remembered after a restart.Also, overscan option does
not work when mattes are used. I found a patch from Robert Jessop, a tvtime
developper on sourceforge tracker. It works fine for me.

Regards,

Laurent

"I had an email sent directly to me from a user asking for matte setting
saving. Strangely enough, I had implemented it for myself ages ago but
for some reason forgot to submit the patch. Anyway, I ported my old changes
forward and A new patch is attached, which works on both 1.0.1 and the
current CVS version.

The patch saves the matte setting in the config file so that it is
remembered when you quit the program. It also makes the overscan setting
apply when mattes are used (I found that you sometimes have gaps at the
sides of the picture). The order of the matte options is changed in the
menu and OSD to make it the same for both 4:3 and anamorphic mode.

Also I've added 'Insert' as a default keyboard shortcut for matte
change. I think this used to be the shortcut a few years ago (on one distro at
least) but disappeared at some point. I tend to switch quite often as some
programs are widescreen and some aren't."

-Robert Jessop

Submitted: Robert ( rj200 ) - 2007-01-12 19:43


-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages tvtime depends on:
ii  debconf [debconf-2.0]  1.5.24            Debian configuration management sy
ii  libc6                  2.7-18            GNU C Library: Shared libraries
ii  libfreetype6           2.3.7-2+lenny1    FreeType 2 font engine, shared lib
ii  libgcc1                1:4.3.2-1.1       GCC support library
ii  libice6                2:1.0.4-1         X11 Inter-Client Exchange library
ii  libpng12-0             1.2.27-2+lenny2   PNG library - runtime
ii  libsm6                 2:1.0.3-2         X11 Session Management library
ii  libstdc++6             4.3.2-1.1         The GNU Standard C++ Library v3
ii  libx11-6               2:1.1.5-2         X11 client-side library
ii  libxext6               2:1.0.4-1         X11 miscellaneous extension librar
ii  libxinerama1           2:1.0.3-2         X11 Xinerama extension library
ii  libxml2                2.6.32.dfsg-5     GNOME XML library
ii  libxtst6               2:1.0.3-1         X11 Testing -- Resource extension 
ii  libxv1                 2:1.0.4-1         X11 Video extension library
ii  libxxf86vm1            1:1.0.2-1         X11 XFree86 video mode extension l
ii  makedev                2.3.1-88          creates device files in /dev
ii  ttf-freefont           20080323-3        Freefont Serif, Sans and Mono True
ii  ucf                    3.0016            Update Configuration File: preserv
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

Versions of packages tvtime recommends:
ii  xmltv-util                    0.5.52-1   Utilities related to the XMLTV fil

Versions of packages tvtime suggests:
pn  lirc-x                        <none>     (no description available)

-- debconf information excluded
diff -urNp ./src/commands.c ../tvtime-1.0.1-savematte/src/commands.c
--- ./src/commands.c	2005-09-08 03:31:48.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/commands.c	2007-01-12 18:24:15.000000000 +0000
@@ -128,6 +128,7 @@ struct commands_s {
     int togglepulldowndetection;
     int togglematte;
     int togglequiet;
+    int changedoverscan;
     int framerate;
     int scan_channels;
     int pause;
@@ -2897,7 +2898,7 @@ void commands_handle( commands_t *cmd, i
     case TVTIME_OVERSCAN_DOWN:
         cmd->overscan = cmd->overscan + ( (tvtime_cmd == TVTIME_OVERSCAN_UP) ? 0.0025 : -0.0025 );
         if( cmd->overscan > 0.4 ) cmd->overscan = 0.4; if( cmd->overscan < 0.0 ) cmd->overscan = 0.0;
-
+        cmd->changedoverscan = 1;
         if( cmd->osd ) {
             char message[ 200 ];
             snprintf( message, sizeof( message ), _("Overscan: %.1f%%"),
@@ -3489,6 +3490,7 @@ void commands_next_frame( commands_t *cm
     cmd->togglepulldowndetection = 0;
     cmd->togglematte = 0;
     cmd->togglequiet = 0;
+    cmd->changedoverscan = 0;
     cmd->resizewindow = 0;
     cmd->setdeinterlacer = 0;
     cmd->setfreqtable = 0;
@@ -3536,6 +3538,11 @@ int commands_toggle_aspect( commands_t *
     return cmd->toggleaspect;
 }
 
+int commands_get_changed_overscan( commands_t *cmd )
+{
+    return cmd->changedoverscan;
+}
+
 int commands_toggle_alwaysontop( commands_t *cmd )
 {
     return cmd->togglealwaysontop;
diff -urNp ./src/commands.h ../tvtime-1.0.1-savematte/src/commands.h
--- ./src/commands.h	2004-10-28 01:50:24.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/commands.h	2007-01-12 18:24:15.000000000 +0000
@@ -64,6 +64,7 @@ void commands_set_pulldown_alg( commands
 int commands_quit( commands_t *cmd );
 int commands_toggle_fullscreen( commands_t *cmd );
 int commands_toggle_aspect( commands_t *cmd );
+int commands_get_changed_overscan( commands_t *cmd );
 int commands_toggle_deinterlacer( commands_t *cmd );
 int commands_toggle_pulldown_detection( commands_t *cmd );
 int commands_toggle_matte( commands_t *cmd );
diff -urNp ./src/tvtime.c ../tvtime-1.0.1-savematte/src/tvtime.c
--- ./src/tvtime.c	2005-09-08 03:55:54.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/tvtime.c	2007-01-12 18:29:25.000000000 +0000
@@ -1062,84 +1062,55 @@ static void build_matte_menu( menu_t *me
     char string[ 128 ];
 
     menu_set_back_command( menu, TVTIME_SHOW_MENU, "output" );
-    if( sixteennine ) {
-        snprintf( string, sizeof( string ), (mode == 0) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("16:9 + Overscan") );
-        menu_set_text( menu, 1, string );
-        menu_set_enter_command( menu, 1, TVTIME_SET_MATTE, "16:9" );
-        snprintf( string, sizeof( string ), (mode == 1) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("1.85:1") );
-        menu_set_text( menu, 2, string );
-        menu_set_enter_command( menu, 2, TVTIME_SET_MATTE, "1.85:1" );
-        snprintf( string, sizeof( string ), (mode == 2) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("2.35:1") );
-        menu_set_text( menu, 3, string );
-        menu_set_enter_command( menu, 3, TVTIME_SET_MATTE, "2.35:1" );
-        snprintf( string, sizeof( string ), (mode == 3) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("4:3 centre") );
-        menu_set_text( menu, 4, string );
-        menu_set_enter_command( menu, 4, TVTIME_SET_MATTE, "4:3" );
-        snprintf( string, sizeof( string ), (mode == 4) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("16:10") );
-        menu_set_text( menu, 5, string );
-        menu_set_enter_command( menu, 5, TVTIME_SET_MATTE, "16:10" );
-    } else {
-        snprintf( string, sizeof( string ), (mode == 0) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("4:3 + Overscan") );
-        menu_set_text( menu, 1, string );
-        menu_set_enter_command( menu, 1, TVTIME_SET_MATTE, "4:3" );
-        snprintf( string, sizeof( string ), (mode == 1) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("16:9") );
-        menu_set_text( menu, 2, string );
-        menu_set_enter_command( menu, 2, TVTIME_SET_MATTE, "16:9" );
-        snprintf( string, sizeof( string ), (mode == 2) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("16:10") );
-        menu_set_text( menu, 3, string );
-        menu_set_enter_command( menu, 3, TVTIME_SET_MATTE, "16:10" );
-        snprintf( string, sizeof( string ), (mode == 3) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("1.85:1") );
-        menu_set_text( menu, 4, string );
-        menu_set_enter_command( menu, 4, TVTIME_SET_MATTE, "1.85:1" );
-        snprintf( string, sizeof( string ), (mode == 4) ?
-                  TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
-                  _("2.35:1") );
-        menu_set_text( menu, 5, string );
-        menu_set_enter_command( menu, 5, TVTIME_SET_MATTE, "2.35:1" );
-    }
+
+    snprintf( string, sizeof( string ), (mode == 0) ?
+              TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
+              _("4:3") );
+    menu_set_text( menu, 1, string );
+    menu_set_enter_command( menu, 1, TVTIME_SET_MATTE, "4:3" );
+    snprintf( string, sizeof( string ), (mode == 1) ?
+              TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
+              _("16:10") );
+    menu_set_text( menu, 2, string );
+    menu_set_enter_command( menu, 2, TVTIME_SET_MATTE, "16:10" );
+    snprintf( string, sizeof( string ), (mode == 2) ?
+              TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
+              _("16:9") );
+    menu_set_text( menu, 3, string );
+    menu_set_enter_command( menu, 3, TVTIME_SET_MATTE, "16:9" );	
+    snprintf( string, sizeof( string ), (mode == 3) ?
+              TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
+              _("1.85:1") );
+    menu_set_text( menu, 4, string );
+    menu_set_enter_command( menu, 4, TVTIME_SET_MATTE, "1.85:1" );
+    snprintf( string, sizeof( string ), (mode == 4) ?
+              TVTIME_ICON_RADIOON "  %s" : TVTIME_ICON_RADIOOFF "  %s",
+              _("2.35:1") );
+    menu_set_text( menu, 5, string );
+    menu_set_enter_command( menu, 5, TVTIME_SET_MATTE, "2.35:1" );
+
 
     snprintf( string, sizeof( string ), TVTIME_ICON_PLAINLEFTARROW "  %s",
               _("Back") );
     menu_set_text( menu, 6, string );
     menu_set_enter_command( menu, 6, TVTIME_SHOW_MENU, "output" );
 }
-
+ 
 static void osd_list_matte( tvtime_osd_t *osd, int mode, int sixteennine )
 {
     tvtime_osd_list_set_lines( osd, 6 );
     if( sixteennine ) {
         tvtime_osd_list_set_text( osd, 0, _("Matte setting (Anamorphic input)") );
-        tvtime_osd_list_set_text( osd, 1, _("16:9 + Overscan") );
-        tvtime_osd_list_set_text( osd, 2, "1.85:1" );
-        tvtime_osd_list_set_text( osd, 3, "2.35:1" );
-        tvtime_osd_list_set_text( osd, 4, _("4:3 centre") );
-        tvtime_osd_list_set_text( osd, 5, "16:10" );
+
     } else {
         tvtime_osd_list_set_text( osd, 0, _("Matte setting (4:3 input)") );
-        tvtime_osd_list_set_text( osd, 1, _("4:3 + Overscan") );
-        tvtime_osd_list_set_text( osd, 2, "16:9" );
-        tvtime_osd_list_set_text( osd, 3, "16:10" );
-        tvtime_osd_list_set_text( osd, 4, "1.85:1" );
-        tvtime_osd_list_set_text( osd, 5, "2.35:1" );
     }
+    tvtime_osd_list_set_text( osd, 1, "4:3" );
+    tvtime_osd_list_set_text( osd, 2, "16:10" );
+    tvtime_osd_list_set_text( osd, 3, "16:9" );
+    tvtime_osd_list_set_text( osd, 4, "1.85:1" );
+    tvtime_osd_list_set_text( osd, 5, "2.35:1" );
+
     tvtime_osd_list_set_hilight( osd, mode + 1 );
     tvtime_osd_show_list( osd, 1, 0 );
 }
@@ -1204,6 +1175,7 @@ int tvtime_main( rtctimer_t *rtctimer, i
     int matte_y = 0;
     int matte_h = 0;
     int matte_mode = 0;
+    int matte_changed = 0;
     int restarttvtime = 0;
     int return_value = 0;
     int last_current_id = -1;
@@ -1241,6 +1213,7 @@ int tvtime_main( rtctimer_t *rtctimer, i
     output = get_xv_output();
 
     sixteennine = config_get_aspect( ct );
+    matte_mode = config_get_matte( ct );
 
     if( !output || !output->init( config_get_geometry( ct ),
                                   sixteennine, config_get_square_pixels( ct ),
@@ -1594,6 +1567,15 @@ int tvtime_main( rtctimer_t *rtctimer, i
     build_fspos_menu( commands_get_menu( commands, "fspos" ),
                       config_get_fullscreen_position( ct ) );
 
+    matte_changed = 1;
+    double matte = 4.0/3.0;
+    
+    /* initialize with safe values until matte is calculated later in the loop. */        
+    matte_x = 0;
+    matte_y = 0;
+    matte_w = width;
+    matte_h = height;
+
     /* Initialize our timestamps. */
     for(;;) {
         const char *fifo_args = 0;
@@ -1607,31 +1589,19 @@ int tvtime_main( rtctimer_t *rtctimer, i
         int exposed = output->is_exposed();
         int current_id;
 
+
         if( vidin && videoinput_has_tuner( vidin ) ) {
             current_id = station_get_current_id( stationmgr );
         } else {
             current_id = 0;
         }
-
-        if( matte_mode ) {
+            /* Since the matte/overscan calculations changed these could probably 
+               be the same variables, but we'll leave it like this for now. */
             output_x = matte_x;
             output_w = matte_w;
             output_y = matte_y;
             output_h = matte_h;
-        } else {
-            output_x = (int) ((((double) width) *
-                               commands_get_overscan( commands )) + 0.5);
-            output_w = (int) ((((double) width) -
-                               (((double) width) *
-                                commands_get_overscan( commands ) * 2.0)) +
-                              0.5);
-            output_y = (int) ((((double) height) *
-                               commands_get_overscan( commands )) + 0.5);
-            output_h = (int) ((((double) height) -
-                               (((double) height) *
-                                commands_get_overscan( commands ) * 2.0)) +
-                              0.5);
-        }
+        
 
         if( fifo ) {
             int cmd;
@@ -1766,11 +1736,14 @@ int tvtime_main( rtctimer_t *rtctimer, i
                                quiet_screenshots );
             commands_refresh_menu( commands );
         }
+
+        
         if( commands_toggle_aspect( commands ) ) {
-            matte_mode = 0;
-            output->set_matte( 0, 0 );
             if( output->toggle_aspect() ) {
                 sixteennine = 1;
+                /* Matte is now always applied so we change it to 16:9 mode too so that
+                   nothing other than overscan is cropped. */
+                matte_mode = 2; 
                 if( osd ) {
                     tvtime_osd_show_message( osd,
                           _("16:9 display mode active.") );
@@ -1780,6 +1753,7 @@ int tvtime_main( rtctimer_t *rtctimer, i
                     ( ( (double) height ) * (16.0 / 9.0) );
             } else {
                 sixteennine = 0;
+                matte_mode = 0;
                 if( osd ) {
                     tvtime_osd_show_message( osd,
                           _("4:3 display mode active.") );
@@ -1800,9 +1774,7 @@ int tvtime_main( rtctimer_t *rtctimer, i
                                output->is_alwaysontop_supported(),
                                output->is_overscan_supported(),
                                quiet_screenshots );
-            build_matte_menu( commands_get_menu( commands, "matte" ),
-                              matte_mode, sixteennine );
-            commands_refresh_menu( commands );
+            matte_changed = 1;
         }
         if( commands_get_fs_pos( commands ) ) {
             const char *fspos = commands_get_fs_pos( commands );
@@ -1839,84 +1811,92 @@ int tvtime_main( rtctimer_t *rtctimer, i
             }
             commands_refresh_menu( commands );
         }
+
+        /* Overscan has been changed so it is calculated and applied with the matte.
+           So changing it now generated this event so that we can tell it to redo the matte. */
+	if( commands_get_changed_overscan( commands ) ) {
+            matte_changed = 1;
+        }
         if( commands_toggle_matte( commands ) ||
             commands_get_matte_mode( commands ) ) {
-            double matte = 4.0 / 3.0;
-            int sqwidth = sixteennine ?
-                ((height * 16) / 9) : ((height * 4) / 3);
-            int sqheight = sixteennine ?
-                ((width * 9) / 16) : ((width * 3) / 4);
 
-            matte_x = 0;
-            matte_w = width;
             if( commands_toggle_matte( commands ) ) {
                 matte_mode = (matte_mode + 1) % 5;
             } else {
-                if( !strcmp( commands_get_matte_mode( commands ), "16:9" ) ) {
-                    matte_mode = sixteennine ? 0 : 1;
-                } else if( !strcmp( commands_get_matte_mode( commands ),
-                                    "16:10" ) ) {
-                    matte_mode = sixteennine ? 4 : 2;
+                if( !strcmp( commands_get_matte_mode( commands ), "16:10" ) ) {
+                    matte_mode = 1;
+		} else if( !strcmp( commands_get_matte_mode( commands ),
+                                    "16:9" ) ) {
+                    matte_mode = 2;
                 } else if( !strcmp( commands_get_matte_mode( commands ),
                                     "1.85:1" ) ) {
-                    matte_mode = sixteennine ? 1 : 3;
+                    matte_mode = 3;
                 } else if( !strcmp( commands_get_matte_mode( commands ),
                                     "2.35:1" ) ) {
-                    matte_mode = sixteennine ? 2 : 4;
+                    matte_mode = 4;
                 } else {
-                    matte_mode = sixteennine ? 3 : 0;
+                    matte_mode = 0;
                 }
             }
-
-            if( sixteennine ) {
-                if( matte_mode == 0 ) {
-                    matte = 16.0 / 9.0;
-                } else if( matte_mode == 1 ) {
-                    matte = 1.85;
-                } else if( matte_mode == 2 ) {
-                    matte = 2.35;
-                } else if( matte_mode == 3 ) {
-                    matte = 4.0 / 3.0;
-                    matte_w = (int) (((double) sqheight * matte) + 0.5);
-                    matte_x = (width - matte_w) / 2;
-                    /* We're cropping the sides off so we add overscan to avoid mess
-                     * at the top of the screen. */
-                    matte_y = commands_get_overscan( commands ) * height / 2;
-                    matte_h = height - matte_y;
-                    output->set_matte( (matte_h * 4) / 3, matte_h );
-                } else if( matte_mode == 4 ) {
-                    matte = 1.6;
-                    matte_w = (int) (((double) sqheight * matte) + 0.5);
-                    matte_x = (width - matte_w) / 2;
-                    /* We're cropping the sides off so we add overscan to avoid mess
-                     * at the top of the screen. */
-                    matte_y = commands_get_overscan( commands ) * height / 2;
-                    matte_h = height - matte_y;
-                    output->set_matte( (matte_h * 16) / 10, matte_h );
-                }
-            } else {
-                if( matte_mode == 1 ) {
-                    matte = 16.0 / 9.0;
-                } else if( matte_mode == 2 ) {
-                    matte = 1.6;
-                } else if( matte_mode == 3 ) {
-                    matte = 1.85;
-                } else if( matte_mode == 4 ) {
-                    matte = 2.35;
-                }
-            }
-            if( !matte_x ) {
-                matte_h = (int) ((((double) sqwidth)/matte) + 0.5);
-                matte_y = (height - matte_h) / 2;
-                output->set_matte( sqwidth, matte_h );
-            }
             if( osd && !commands_menu_active( commands ) ) {
                 osd_list_matte( osd, matte_mode, sixteennine );
             }
             build_matte_menu( commands_get_menu( commands, "matte" ),
                               matte_mode, sixteennine );
             commands_refresh_menu( commands );
+            matte_changed = 1;
         }
+        if (matte_changed) {
+            matte_changed = 0;
+
+            /* start with overscan then apply matte */
+            matte_x = (int) ((((double) width) *
+                               commands_get_overscan( commands )) + 0.5);
+            matte_w = (int) ((((double) width) -
+                               (((double) width) *
+                                commands_get_overscan( commands ) * 2.0)) +
+                              0.5);
+            matte_y = (int) ((((double) height) *
+                               commands_get_overscan( commands )) + 0.5);
+            matte_h = (int) ((((double) height) -
+                               (((double) height) *
+                                commands_get_overscan( commands ) * 2.0)) +
+                              0.5);
+
+            int sqwidth = sixteennine ?
+                ((matte_h * 16) / 9) : ((matte_h * 4) / 3);
+            int sqheight = sixteennine ?
+                ((matte_w * 9) / 16) : ((matte_w * 3) / 4);
+
+            if( matte_mode == 0 ) {
+                matte = 4.0 / 3.0;
+                config_save( ct, "Matte", "4:3" );
+            } else if( matte_mode == 1 ) {
+                matte = 1.6;
+                config_save( ct, "Matte", "16:10" );
+            } else if( matte_mode == 2 ) {
+                matte = 16.0/9.0;
+                config_save( ct, "Matte", "16:9" );
+            } else if( matte_mode == 3 ) {
+                matte = 1.85;                    
+                config_save( ct, "Matte", "1.85:1" );
+            } else if( matte_mode == 4 ) {
+                matte = 2.35;
+                config_save( ct, "Matte", "2.35:1" );
+            }
+
+            if( sixteennine && matte < (16.0/9.0) )
+            {
+                matte_w = (int) (((double) sqheight * matte) + 0.5);
+                matte_x = (width - matte_w) / 2;		    
+                output->set_matte( matte_w, sqheight );
+            } else {
+                matte_h = (int) ((((double) sqwidth)/matte) + 0.5);
+                matte_y = (height - matte_h) / 2;
+                output->set_matte( sqwidth, matte_h );
+            }
+        }
+
         if( commands_toggle_pulldown_detection( commands ) ) {
             if( height == 480 ) {
                 tvtime->pulldown_alg =
diff -urNp ./src/tvtimeconf.c ../tvtime-1.0.1-savematte/src/tvtimeconf.c
--- ./src/tvtimeconf.c	2005-09-08 05:07:56.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/tvtimeconf.c	2007-01-12 18:26:09.000000000 +0000
@@ -56,6 +56,7 @@ struct config_s
     char *geometry;
     int verbose;
     int aspect;
+    int matte;
     int squarepixels;
     int debug;
     int fullscreen;
@@ -290,6 +291,22 @@ static void parse_option( config_t *ct, 
             ct->aspect = atoi( curval );
         }
 
+        if( !xmlStrcasecmp( name, BAD_CAST "Matte" ) ) {            
+            if(!strcmp( curval, "4:3")) {
+                ct->matte = 0;
+            } else if(!strcmp( curval, "16:10")) {
+                ct->matte = 1;
+            } else if(!strcmp( curval, "16:9")) {
+                ct->matte = 2;
+            } else if(!strcmp( curval, "1.85:1")) {
+                ct->matte = 3;
+            } else if(!strcmp( curval, "2.35:1")) {
+                ct->matte = 4;
+            } 
+            /* No valid matte if found ct->matte will be -1 and config_get_matte will choose 
+               a default based on the aspect ratio. */
+        }
+
         if( !xmlStrcasecmp( name, BAD_CAST "DebugMode" ) ) {
             ct->debug = atoi( curval );
         }
@@ -712,6 +729,7 @@ config_t *config_new( void )
     ct->geometry = strdup( "0x576" );
     ct->verbose = 0;
     ct->aspect = 0;
+    ct->matte = -1;
     ct->squarepixels = 1;
     ct->debug = 0;
     ct->fullscreen = 0;
@@ -807,6 +825,10 @@ config_t *config_new( void )
     ct->keymap[ 'a' ] = TVTIME_TOGGLE_ASPECT;
     ct->keymap[ 'f' ] = TVTIME_TOGGLE_FULLSCREEN;
     ct->keymap[ 'i' ] = TVTIME_TOGGLE_INPUT;
+    ct->keymap[ 'a' ] = TVTIME_TOGGLE_ASPECT;
+    ct->keymap[ I_INSERT ] = TVTIME_TOGGLE_MATTE;
+    ct->keymap[ ',' ] = TVTIME_OVERSCAN_DOWN;
+    ct->keymap[ '.' ] = TVTIME_OVERSCAN_DOWN;
     ct->keymap[ 's' ] = TVTIME_SCREENSHOT;
     ct->keymap[ ',' ] = TVTIME_MIXER_TOGGLE_MUTE;
     ct->keymap[ 'e' ] = TVTIME_TOGGLE_AUDIO_MODE;
@@ -1451,6 +1473,13 @@ int config_get_aspect( config_t *ct )
     return ct->aspect;
 }
 
+int config_get_matte( config_t *ct )
+{
+    /* If matte is not set then default to 0 for normal or 2 for widescreen. */
+    if (ct->matte == -1) return ct->aspect * 2;
+    return ct->matte;
+}
+
 int config_get_start_channel( config_t *ct )
 {
     return ct->start_channel;
diff -urNp ./src/tvtimeconf.h ../tvtime-1.0.1-savematte/src/tvtimeconf.h
--- ./src/tvtimeconf.h	2005-08-14 18:00:11.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/tvtimeconf.h	2007-01-12 18:24:15.000000000 +0000
@@ -151,6 +151,7 @@ int config_get_debug( config_t *ct );
 const char *config_get_geometry( config_t *ct );
 int config_get_inputwidth( config_t *ct );
 int config_get_aspect( config_t *ct );
+int config_get_matte( config_t *ct );
 int config_get_inputnum( config_t *ct );
 const char *config_get_v4l_device( config_t *ct );
 const char *config_get_v4l_norm( config_t *ct );
diff -urNp ./src/videoinput.c ../tvtime-1.0.1-savematte/src/videoinput.c
--- ./src/videoinput.c	2005-09-08 04:13:37.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/videoinput.c	2007-01-12 18:24:15.000000000 +0000
@@ -376,6 +376,7 @@ uint8_t *videoinput_next_frame( videoinp
  
         wait_for_frame_v4l2( vidin );
  
+        videoinput_get_aspect( vidin );
         cur_buf.type = vidin->capbuffers[ 0 ].vidbuf.type;
         if( ioctl( vidin->grab_fd, VIDIOC_DQBUF, &cur_buf ) < 0 ) {
             /* some drivers return EIO when there is no signal */
@@ -1148,6 +1149,22 @@ void videoinput_set_saturation_relative(
     }
 }
 
+float videoinput_get_aspect( videoinput_t *vidin )
+{
+    float aspect = 1.0;
+
+    if( vidin->isv4l2 ) {
+        struct v4l2_cropcap cropcap;
+        /* on success 0 is returned */
+        if( !ioctl( vidin->grab_fd, VIDIOC_CROPCAP, &cropcap ) ) {
+            aspect = (float)cropcap.pixelaspect.numerator / (float)cropcap.pixelaspect.denominator;
+            fprintf( stderr, "videoinput: Aspect ratio: %f\n", aspect);         
+        }
+    }
+   
+    return aspect;
+}
+
 static void videoinput_do_mute( videoinput_t *vidin, int mute )
 {
     if( vidin->hasaudio && mute != vidin->hw_muted ) {
diff -urNp ./src/videoinput.h ../tvtime-1.0.1-savematte/src/videoinput.h
--- ./src/videoinput.h	2005-09-08 03:55:10.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/videoinput.h	2007-01-12 18:24:15.000000000 +0000
@@ -71,6 +71,8 @@ typedef struct videoinput_s videoinput_t
 #define VIDEOINPUT_LANG1   4
 #define VIDEOINPUT_LANG2   8
 
+float videoinput_get_aspect( videoinput_t *vidin );
+
 /**
  * Possible PAL audio modes, for the cx88 driver that cannot autodetect.
  */
diff -urNp ./src/xvoutput.c ../tvtime-1.0.1-savematte/src/xvoutput.c
--- ./src/xvoutput.c	2005-08-14 18:35:50.000000000 +0100
+++ ../tvtime-1.0.1-savematte/src/xvoutput.c	2007-01-12 18:24:15.000000000 +0000
@@ -233,7 +233,7 @@ static int xv_alloc_frame( void )
 {
     int size;
     uint8_t *alloc;
-
+    
     size = input_width * input_height * 2;
     if( use_shm ) {
         alloc = create_shm( size );

 	  	 

--- End Message ---
--- Begin Message ---
Source: tvtime
Source-Version: 1.0.11-1

We believe that the bug you reported is fixed in the latest version of
tvtime, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 526639@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Adrian Bunk <bunk@debian.org> (supplier of updated tvtime package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 26 Jan 2017 12:40:33 +0200
Source: tvtime
Binary: tvtime
Architecture: source
Version: 1.0.11-1
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Adrian Bunk <bunk@debian.org>
Description:
 tvtime     - analog television display application
Closes: 243738 243747 441218 526639 588571 653376 743845
Changes:
 tvtime (1.0.11-1) unstable; urgency=medium
 .
   * QA upload.
   * New upstream release from new upstream. (Closes: #653376)
     - Remove patches applied upstream.
     - Build-depend on libasound2-dev.
     - oss-compat is no longer required. (Closes: #588571)
     - Fixes crash when no v4l capture devices are found.
       (Closes: #743845)
     - Broken aspect hinting is fixed. (Closes: #243747)
     - Save/restore output matte setting on exit/startup added.
       (Closes: #526639)
     - Increased osd fadeout time and makes it a less sickly color.
       (Closes: #441218)
     - Works fine under remote access. (Closes: #243738)
   * Remove the obsolete menu entry.
   * Slightly modernize the package description.
Checksums-Sha1:
 e00888da6a943347b34623afb2892210604e1c6b 1914 tvtime_1.0.11-1.dsc
 4447eb7ce4097d7f7660bf3e6ff7985a47415426 1840664 tvtime_1.0.11.orig.tar.gz
 6c8e709291a7ae82c8810c64b64d31fb4416cc1d 39096 tvtime_1.0.11-1.debian.tar.xz
Checksums-Sha256:
 4aa6690a1943e19d9ae8ce4f5c62e566586c86a50b932563a79c9282871f3345 1914 tvtime_1.0.11-1.dsc
 403bf2106578b1f3d6ce70bc08654f7a90753f19e27b4cc170bc636307cdc78c 1840664 tvtime_1.0.11.orig.tar.gz
 015db1150cbfc5cb5157ac92bdd0e34184fffb574547de07525960404e651d9e 39096 tvtime_1.0.11-1.debian.tar.xz
Files:
 e260d5a13b99875d86c3e9deb717e801 1914 video optional tvtime_1.0.11-1.dsc
 f4adba831376a8baad92dbda49056138 1840664 video optional tvtime_1.0.11.orig.tar.gz
 7436cfe1cb99adb5a0623b12c5a864b1 39096 video optional tvtime_1.0.11-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEOvp1f6xuoR0v9F3wiNJCh6LYmLEFAliJ7TMACgkQiNJCh6LY
mLFKOBAAipo86ofhWtFtiZcrpue5qBxZMhx/SS9DQNh+f6uWFo0/KXnAb8PP2RCY
wJWpCBPJ8VOIRUg1NwpmT2xNkk0o4frobRN6psC3bsEJgzcbBsN6xWGtnDyfM2VF
A7wjGbOGKyr26g3am5MpNkq7mS7S810tFjIyrtWV2x/2Y0lTWgjt/RrbQup5e+Az
s13joUm0JwM/jHqBL0oEVEwPuLlDCB2zPjftyoQPp6QELPeoL1tqfJdtjn9FPLxj
DyKFQ+G867my2XDQ2pW0yqNSjMYs3G+MA4QrvRwSitC5s/8N3liVMeZU++F9MlB6
A/vlpoTXVlS1tvvGuBDd4sArPYQwwJUMr8sfZQHCk5RIAix4HAfB7wESKXNew3Ir
owd4fq/qO5DLzj9TkrxUdcHQdTMM3G5PFmvLVosKhAYZA5fxSR4bb2JoxfXYwVeV
iABcns342GfvMcxiGczc+uPRFHtyTCGaCI6SN3pALf/tesE6r5vm6Ov8U8/zDxMS
UHJsV/AnW+F1mCEMqfquzN/rYQ2dFcgnWozadr+V4zZteAbFxeZvLE1ErxSsesDL
3m4dtpwjJJAualmwMwBP0Glndfu1ewG0v+EL9ViKeopgIa0wOgZ4DFZcRVQPxwZJ
JqZP3AswuK0sAamkhMN6VBw20e09/1rosKe/HZvdltXwc7r4Qx0=
=rPIE
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: