]> git.sesse.net Git - vlc/commitdiff
Fix progress dialog scale
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 10 Mar 2009 18:05:59 +0000 (20:05 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 10 Mar 2009 18:05:59 +0000 (20:05 +0200)
modules/access/dvb/scan.c
modules/demux/avi/avi.c
src/misc/update.c

index ef230564ff270dad9953984b8d42f2a5028ac985..23316ab0d9a71ee85d960babca3b087194a28a94 100644 (file)
@@ -320,7 +320,7 @@ int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg )
         if( p_scan->p_dialog == NULL )
             p_scan->p_dialog = dialog_ProgressCreate( p_scan->p_obj, _("Scanning DVB-T"), psz_text, _("Cancel") );
         if( p_scan->p_dialog != NULL )
-            dialog_ProgressSet( p_scan->p_dialog, psz_text, 100 * f_position );
+            dialog_ProgressSet( p_scan->p_dialog, psz_text, f_position );
         free( psz_text );
     }
 
index 1eabbf7eef266d0fc9f4bf58bfbea6dc463f8c8f..ec31313e0e831b88ba83bbb41996ba62b199a08e 100644 (file)
@@ -2415,8 +2415,8 @@ static void AVI_IndexCreate( demux_t *p_demux )
             if( dialog_ProgressCancelled( p_dialog ) )
                 break;
 
-            double f_pos = 100.0 * stream_Tell( p_demux->s ) /
-                           stream_Size( p_demux->s );
+            float f_pos = (float)stream_Tell( p_demux->s ) /
+                          (float)stream_Size( p_demux->s );
             dialog_ProgressSet( p_dialog, NULL, f_pos );
 
             i_dialog_update = mdate();
index 56038ef84959401e763cff529eb22ff4a49f1e36..2afbf1e300887ae953728299921e0bcd99ea14a9 100644 (file)
@@ -1606,7 +1606,7 @@ static void* update_DownloadReal( vlc_object_t *p_this )
 
         l_downloaded += i_read;
         psz_downloaded = size_str( l_downloaded );
-        f_progress = 100.0*(float)l_downloaded/(float)l_size;
+        f_progress = (float)l_downloaded/(float)l_size;
 
         if( asprintf( &psz_status, _( "%s\nDownloading... %s/%s %.1f%% done" ),
                       p_update->release.psz_url, psz_downloaded, psz_size,