Used video_format_ScaleCropAr in scale.c/swscale.c
authorLaurent Aimar <fenrir@videolan.org>
Sat, 13 Nov 2010 19:41:36 +0000 (20:41 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 26 Nov 2010 21:33:13 +0000 (22:33 +0100)
modules/video_filter/scale.c
modules/video_filter/swscale.c

index 0f72c5b..66384db 100644 (file)
@@ -67,6 +67,7 @@ static int OpenFilter( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
         return VLC_EGENERIC;
     }
 
+    video_format_ScaleCropAr( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
     p_filter->pf_video_filter = Filter;
 
     msg_Dbg( p_filter, "%ix%i -> %ix%i", p_filter->fmt_in.video.i_width,
     p_filter->pf_video_filter = Filter;
 
     msg_Dbg( p_filter, "%ix%i -> %ix%i", p_filter->fmt_in.video.i_width,
@@ -94,6 +95,8 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         (p_filter->fmt_out.video.i_width == 0) )
         return NULL;
 
         (p_filter->fmt_out.video.i_width == 0) )
         return NULL;
 
+    video_format_ScaleCropAr( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
+
     /* Request output picture */
     p_pic_dst = filter_NewPicture( p_filter );
     if( !p_pic_dst )
     /* Request output picture */
     p_pic_dst = filter_NewPicture( p_filter );
     if( !p_pic_dst )
index ffa2b1d..b60c5f6 100644 (file)
@@ -347,7 +347,7 @@ static int Init( filter_t *p_filter )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     const video_format_t *p_fmti = &p_filter->fmt_in.video;
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     const video_format_t *p_fmti = &p_filter->fmt_in.video;
-    const video_format_t *p_fmto = &p_filter->fmt_out.video;
+    video_format_t       *p_fmto = &p_filter->fmt_out.video;
 
     if( IsFmtSimilar( p_fmti, &p_sys->fmt_in ) &&
         IsFmtSimilar( p_fmto, &p_sys->fmt_out ) &&
 
     if( IsFmtSimilar( p_fmti, &p_sys->fmt_in ) &&
         IsFmtSimilar( p_fmto, &p_sys->fmt_out ) &&
@@ -424,6 +424,7 @@ static int Init( filter_t *p_filter )
     p_sys->b_swap_uvi = cfg.b_swap_uvi;
     p_sys->b_swap_uvo = cfg.b_swap_uvo;
 
     p_sys->b_swap_uvi = cfg.b_swap_uvi;
     p_sys->b_swap_uvo = cfg.b_swap_uvo;
 
+    video_format_ScaleCropAr( p_fmto, p_fmti );
 #if 0
     msg_Dbg( p_filter, "%ix%i chroma: %4.4s -> %ix%i chroma: %4.4s extend by %d",
              p_fmti->i_width, p_fmti->i_height, (char *)&p_fmti->i_chroma,
 #if 0
     msg_Dbg( p_filter, "%ix%i chroma: %4.4s -> %ix%i chroma: %4.4s extend by %d",
              p_fmti->i_width, p_fmti->i_height, (char *)&p_fmti->i_chroma,