Ticket #2198: 1080iTranscode.patch
File 1080iTranscode.patch, 2.5 KB (added by , 17 years ago) |
---|
-
programs/mythtranscode/transcode.cpp
348 348 349 349 int video_width = nvp->GetVideoWidth(); 350 350 int video_height = nvp->GetVideoHeight(); 351 352 if (video_height == 1088) { 353 VERBOSE(VB_IMPORTANT, QString("Unlikely the video height really is 1088, using hacks...")); 354 } 355 351 356 float video_aspect = nvp->GetVideoAspect(); 352 357 float video_frame_rate = nvp->GetFrameRate(); 353 358 long long total_frame_count = nvp->GetTotalFrameCount(); … … 382 387 { 383 388 newWidth = profile.byName("width")->getValue().toInt(); 384 389 newHeight = profile.byName("height")->getValue().toInt(); 385 386 if (profile.byName("transcodepreserveaspect")->getValue().toInt()) 387 newHeight = (int)(1.0 * newWidth * video_height / video_width); 388 390 if (profile.byName("transcodepreserveaspect")->getValue().toInt()) { 391 if (video_height==1088) { 392 newHeight = (int)(1.0 * newWidth * 1080 / video_width); 393 } else { 394 newHeight = (int)(1.0 * newWidth * video_height / video_width); 395 } 396 } 389 397 if (encodingType.left(4).lower() == "mpeg") 390 398 { 391 399 // make sure dimensions are valid for MPEG codecs … … 702 710 video_width, video_height); 703 711 avpicture_fill(&imageOut, frame.buf, PIX_FMT_YUV420P, 704 712 newWidth, newHeight); 705 scontext = img_resample_init(newWidth, newHeight, 706 video_width, video_height); 713 if (video_height != 1088) { 714 scontext = img_resample_init(newWidth, newHeight, 715 video_width, video_height); 716 } else { 717 scontext = img_resample_full_init(newWidth, newHeight, 718 video_width, video_height, 719 0,8,0,0, 720 0,0,0,0); 721 } 707 722 img_resample(scontext, &imageOut, &imageIn); 708 723 img_resample_close(scontext); 709 724 }