]> granicus.if.org Git - handbrake/commitdiff
Fix source dimensions problem with some mpeg2 streams
authorjstebbins <jstebbins.hb@gmail.com>
Sun, 13 Mar 2011 17:14:36 +0000 (17:14 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Sun, 13 Mar 2011 17:14:36 +0000 (17:14 +0000)
Was using the incorrect field for actual "display" dimensions of video.
The field I was using is most often used for pan and scan which
crops a 16:9 image to fit a 4:3 display.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3847 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/decmpeg2.c

index 6f7c8e7e14c72676e92af505e3e8f01bd2a65f98..19d1d42132d0f7c67b43ebfa08e926bea9b30bb3 100644 (file)
@@ -360,8 +360,8 @@ static int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es,
         {
             if( !( m->width && m->height && m->rate ) )
             {
-                m->width  = m->info->sequence->display_width;
-                m->height = m->info->sequence->display_height;
+                m->width  = m->info->sequence->picture_width;
+                m->height = m->info->sequence->picture_height;
                 m->rate   = m->info->sequence->frame_period;
                 if ( m->aspect_ratio <= 0 && m->height &&
                      m->info->sequence->pixel_height )
@@ -408,13 +408,13 @@ static int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es,
             if( m->got_iframe )
             {
                 int crop[4] = {0};
-                if ( m->info->sequence->display_width < m->info->sequence->width )
+                if ( m->info->sequence->picture_width < m->info->sequence->width )
                 {
-                    crop[3] = m->info->sequence->width - m->info->sequence->display_width;
+                    crop[3] = m->info->sequence->width - m->info->sequence->picture_width;
                 }
-                if ( m->info->sequence->display_height < m->info->sequence->height )
+                if ( m->info->sequence->picture_height < m->info->sequence->height )
                 {
-                    crop[1] = m->info->sequence->height - m->info->sequence->display_height;
+                    crop[1] = m->info->sequence->height - m->info->sequence->picture_height;
                 }
                 buf  = hb_copy_frame( m->job, 
                                       m->info->sequence->width,