@@ -101,30 +101,36 @@ bool ffPrintDisplay(FFDisplayOptions* options)
101
101
102
102
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate ();
103
103
double inch = sqrt (result -> physicalWidth * result -> physicalWidth + result -> physicalHeight * result -> physicalHeight ) / 25.4 ;
104
+ double scaleFactor = (double ) result -> height / (double ) result -> scaledHeight ;
104
105
105
106
if (options -> moduleArgs .outputFormat .length == 0 )
106
107
{
107
108
ffPrintLogoAndKey (key .chars , 0 , & options -> moduleArgs , FF_PRINT_TYPE_NO_CUSTOM_KEY );
108
109
109
110
ffStrbufAppendF (& buffer , "%ix%i" , result -> width , result -> height );
110
111
111
- if (result -> refreshRate > 0 )
112
- {
113
- const char * space = instance .config .display .freqSpaceBeforeUnit == FF_SPACE_BEFORE_UNIT_NEVER ? "" : " " ;
114
- if (options -> preciseRefreshRate )
115
- ffStrbufAppendF (& buffer , " @ %g%sHz" , ((int ) (result -> refreshRate * 1000 + 0.5 )) / 1000.0 , space );
116
- else
117
- ffStrbufAppendF (& buffer , " @ %i%sHz" , (uint32_t ) (result -> refreshRate + 0.5 ), space );
118
- }
119
-
120
112
if (
121
113
result -> scaledWidth > 0 && result -> scaledWidth != result -> width &&
122
114
result -> scaledHeight > 0 && result -> scaledHeight != result -> height )
123
- ffStrbufAppendF (& buffer , " (as %ix%i)" , result -> scaledWidth , result -> scaledHeight );
115
+ {
116
+ ffStrbufAppendS (& buffer , " @ " );
117
+ ffStrbufAppendDouble (& buffer , scaleFactor , instance .config .display .fractionNdigits , instance .config .display .fractionTrailingZeros == FF_FRACTION_TRAILING_ZEROS_TYPE_SHOW );
118
+ ffStrbufAppendC (& buffer , 'x' );
119
+ }
124
120
125
121
if (inch > 1 )
126
122
ffStrbufAppendF (& buffer , " in %i\"" , (uint32_t ) (inch + 0.5 ));
127
123
124
+ if (result -> refreshRate > 0 )
125
+ {
126
+ ffStrbufAppendS (& buffer , ", " );
127
+ if (options -> preciseRefreshRate )
128
+ ffStrbufAppendDouble (& buffer , result -> refreshRate , 3 , false);
129
+ else
130
+ ffStrbufAppendSInt (& buffer , (int ) (result -> refreshRate + 0.5 ));
131
+ ffStrbufAppendS (& buffer , instance .config .display .freqSpaceBeforeUnit == FF_SPACE_BEFORE_UNIT_NEVER ? "Hz" : " Hz" );
132
+ }
133
+
128
134
bool flag = false;
129
135
if (result -> type != FF_DISPLAY_TYPE_UNKNOWN )
130
136
{
@@ -185,8 +191,6 @@ bool ffPrintDisplay(FFDisplayOptions* options)
185
191
else
186
192
buf [0 ] = '\0' ;
187
193
188
- double scaleFactor = (double ) result -> height / (double ) result -> scaledHeight ;
189
-
190
194
FF_PRINT_FORMAT_CHECKED (key .chars , 0 , & options -> moduleArgs , FF_PRINT_TYPE_NO_CUSTOM_KEY , ((FFformatarg []) {
191
195
FF_FORMAT_ARG (result -> width , "width" ),
192
196
FF_FORMAT_ARG (result -> height , "height" ),
0 commit comments