[Kwintv] patch for fine tuning xawtv import

Koos Vriezen koos.vriezen at xs4all.nl
Sat Dec 13 23:33:27 CET 2003


Hi,

The auto scanning did find a lot of channels, but on none of them was a
tuned tv station. So I tried the xawtv import and that failed to get the
fine tuning right. Eg

#Nederland 1           11-     216.00
[Ned1]
channel = E11
fine=-20

was set to 217250-20=217230, but it should be 216000. A quick calculation
showed it should be in steps of 62.5 (not quite sure though could be 50
or 75 also, but 62.5 makes sense).
Attached a patch for it.

Koos
-------------- next part --------------
Index: qtvision/plugins/channel/xawtv/channelioxawtv.cpp
===================================================================
RCS file: /home/kde/kdenonbeta/kwintv3/qtvision/plugins/channel/xawtv/channelioxawtv.cpp,v
retrieving revision 1.10
diff -u -3 -p -r1.10 channelioxawtv.cpp
--- qtvision/plugins/channel/xawtv/channelioxawtv.cpp	25 Oct 2003 18:03:15 -0000	1.10
+++ qtvision/plugins/channel/xawtv/channelioxawtv.cpp	13 Dec 2003 22:26:01 -0000
@@ -104,11 +104,14 @@ bool ChannelIOFormatXawtv::load(ChannelS
 	{
 		Channel *channel = new Channel( store );
 		channel->setName( (*it).name );
+		unsigned long freq;
 		if ( !( *it ).params[ "freq" ].isEmpty() )
-			channel->setFreq( ( *it ).params[ "freq" ].toULong() );
-		else channel->setFreq( channelToFrequency( ( *it ).params[ "channel" ] ) );
+			freq = ( *it ).params[ "freq" ].toULong();
+		else
+			freq = channelToFrequency( ( *it ).params[ "channel" ] );
 		if ( !( *it ).params[ "fine" ].isEmpty() )
-			channel->setFreq( channel->freq() + ( *it ).params[ "fine" ].toLong() );
+			freq += (unsigned long) 62.5 * ( *it ).params[ "fine" ].toLong();
+		channel->setFreq( freq );
 		if ( !( *it ).params[ "norm" ].isEmpty() )
 			channel->setEncoding( ( *it ).params[ "norm" ].lower() );
 		if ( !( *it ).params[ "input" ].isEmpty() )


More information about the kwintv mailing list