Ticket #1365: add-display-res-option.diff
| File add-display-res-option.diff, 2.7 KB (added by cantabile, 18 months ago) |
|---|
-
src/dialog_options.cpp
385 385 Bind(control,_T("Show keyframes on video slider")); 386 386 videoSizer3->Add(control,0,wxEXPAND); 387 387 videoSizer3->AddGrowableCol(1,1); 388 control = new wxCheckBox(videoPage,-1,_("Use display aspect ratio (ffmpegsource only)")); 389 Bind(control,_T("Use display aspect ratio")); 390 videoSizer3->Add(control,0,wxEXPAND); 391 videoSizer3->AddGrowableCol(1,1); 388 392 389 393 // Second sizer 390 394 videoSizer4->Add(new wxStaticText(videoPage,-1,_("Video provider: ")),0,wxALIGN_CENTER_VERTICAL | wxRIGHT,10); -
src/options.cpp
159 159 SetBool(_T("Show keyframes on video slider"),true); 160 160 SetBool(_T("Show overscan mask"),false); 161 161 162 SetModificationType(MOD_VIDEO_RELOAD); 163 SetBool(_T("Use display aspect ratio"),false); 164 162 165 // Video Provider (Advanced) 163 166 SetModificationType(MOD_VIDEO_RELOAD); 164 167 SetInt(_T("Avisynth MemoryMax"),64,1700); -
src/video_context.cpp
216 216 int n = frame_n; 217 217 SetVideo(_T("")); 218 218 SetVideo(name); 219 // without this, subtitles don't appear anymore 220 Refresh(true, true); 221 // without this, the video doesn't get resized 222 UpdateDisplays(true); 219 223 JumpToFrame(n); 220 224 } 221 225 } -
src/video_provider_ffmpegsource.cpp
224 224 ErrorMsg.Append(wxString::Format(_T("Failed to decode first frame: %s"), ErrInfo.Buffer)); 225 225 throw ErrorMsg; 226 226 } 227 227 228 Width = TempFrame->EncodedWidth; 228 229 Height = TempFrame->EncodedHeight; 229 230 231 // possibly request the frames at their display resolution 232 if (Options.AsBool(_T("Use display aspect ratio"))) { 233 int sarNumerator = VideoInfo->SARNum; 234 int sarDenominator = VideoInfo->SARDen; 235 // check them both lest we divide by zero 236 if (sarNumerator != 0 && sarDenominator != 0) { 237 if (sarNumerator > sarDenominator) { 238 Width = Width * sarNumerator / sarDenominator; 239 } 240 else if (sarNumerator < sarDenominator) { 241 Height = Height * sarDenominator / sarNumerator; 242 } 243 } 244 } 245 230 246 if (FFMS_SetOutputFormatV(VideoSource, 1 << FFMS_GetPixFmt("bgra"), Width, Height, FFMS_RESIZER_BICUBIC, &ErrInfo)) { 231 247 ErrorMsg.Append(wxString::Format(_T("Failed to set output format: %s"), ErrInfo.Buffer)); 232 248 throw ErrorMsg;
