X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fgtk2%2Fproducer_pixbuf.c;h=1ba370f9bd2004823be5d587c45877819b72d21c;hb=9d64164b417c1d76e6fe06bbaddfa787ec0e8ee9;hp=8a74a468fb13849054785bca922ee430764b1450;hpb=661165812e3410fe2f6f49d7af882b36a0efcf82;p=melted diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index 8a74a46..1ba370f 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -40,6 +40,7 @@ mlt_producer producer_pixbuf_init( const char *filename ) this->filename = strdup( filename ); this->counter = -1; + this->is_pal = 1; g_type_init(); return producer; @@ -83,7 +84,7 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma return 0; } -uint8_t *producer_get_alpha_mask( mlt_frame this ) +static uint8_t *producer_get_alpha_mask( mlt_frame this ) { // Obtain properties of frame mlt_properties properties = mlt_frame_properties( this ); @@ -145,6 +146,26 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i // If we have a pixbuf if ( pixbuf ) { + // Scale to adjust for sample aspect ratio + if ( this->is_pal ) + { + GdkPixbuf *temp = pixbuf; + GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf, + (gint) ( (float) gdk_pixbuf_get_width( pixbuf ) * 54.0/59.0), + gdk_pixbuf_get_height( pixbuf ), GDK_INTERP_HYPER ); + pixbuf = scaled; + g_object_unref( temp ); + } + else + { + GdkPixbuf *temp = pixbuf; + GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf, + (gint) ( (float) gdk_pixbuf_get_width( pixbuf ) * 11.0/10.0 ), + gdk_pixbuf_get_height( pixbuf ), GDK_INTERP_HYPER ); + pixbuf = scaled; + g_object_unref( temp ); + } + // Store width and height this->width = gdk_pixbuf_get_width( pixbuf ); this->height = gdk_pixbuf_get_height( pixbuf );