diff options
author | jbrjake <[email protected]> | 2008-05-29 15:54:08 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2008-05-29 15:54:08 +0000 |
commit | 68799d8e3d4858f3cfe8a3c4227a7823dbafa39c (patch) | |
tree | cb9889335f95e18c892d78e878576ee3ac93f9f9 /libhb/work.c | |
parent | 3c04263c1c974dc44ae38415dc2bbab884eb311d (diff) |
When encoding anamorphic with lavc, ensure PAR values are 8-bit. Thanks, j45!
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1470 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r-- | libhb/work.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libhb/work.c b/libhb/work.c index 503403edd..9c2ecbf9a 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -136,7 +136,21 @@ static void do_job( hb_job_t * job, int cpu_count ) so they fit into the user's specified dimensions. */ hb_set_anamorphic_size(job, &job->width, &job->height, &job->pixel_aspect_width, &job->pixel_aspect_height); } - + + if( job->pixel_ratio && job->vcodec == HB_VCODEC_FFMPEG) + { + /* Just to make working with ffmpeg even more fun, + lavc's MPEG-4 encoder can't handle PAR values >= 255, + even though AVRational does. Adjusting downwards + distorts the display aspect slightly, but such is life. */ + while ((job->pixel_aspect_width & ~0xFF) || + (job->pixel_aspect_height & ~0xFF)) + { + job->pixel_aspect_width >>= 1; + job->pixel_aspect_height >>= 1; + } + } + /* Keep width and height within these boundaries, but ignore for "loose" anamorphic encodes, for which this stuff is covered in the pixel_ratio |