[Mplayer-cvslog] CVS: main/libmpcodecs vd_mpng.c,1.4,1.5
Alex Beregszaszi
alex at mplayerhq.hu
Sun Dec 22 17:31:07 CET 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv1536/libmpcodecs
Modified Files:
vd_mpng.c
Log Message:
dos2unix conversion
Index: vd_mpng.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_mpng.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vd_mpng.c 22 Sep 2002 02:33:25 -0000 1.4
+++ vd_mpng.c 22 Dec 2002 16:31:04 -0000 1.5
@@ -47,41 +47,41 @@
//mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
-static int pngPointer;
-static int pngLength;
-
-static void pngReadFN( png_structp pngstr,png_bytep buffer,png_size_t size )
-{
- char * p = pngstr->io_ptr;
+static int pngPointer;
+static int pngLength;
+
+static void pngReadFN( png_structp pngstr,png_bytep buffer,png_size_t size )
+{
+ char * p = pngstr->io_ptr;
if(size>pngLength-pngPointer && pngLength>=pngPointer) size=pngLength-pngPointer;
- memcpy( buffer,(char *)&p[pngPointer],size );
- pngPointer+=size;
-}
+ memcpy( buffer,(char *)&p[pngPointer],size );
+ pngPointer+=size;
+}
// decode a frame
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
- png_structp png;
- png_infop info;
- png_infop endinfo;
-// png_bytep data;
- png_bytep * row_p;
- png_uint_32 png_width=0,png_height=0;
- int depth,color;
- png_uint_32 i;
+ png_structp png;
+ png_infop info;
+ png_infop endinfo;
+// png_bytep data;
+ png_bytep * row_p;
+ png_uint_32 png_width=0,png_height=0;
+ int depth,color;
+ png_uint_32 i;
mp_image_t* mpi;
if(len<=0) return NULL; // skipped frame
- png=png_create_read_struct( PNG_LIBPNG_VER_STRING,NULL,NULL,NULL );
- info=png_create_info_struct( png );
- endinfo=png_create_info_struct( png );
-
- pngPointer=8;
+ png=png_create_read_struct( PNG_LIBPNG_VER_STRING,NULL,NULL,NULL );
+ info=png_create_info_struct( png );
+ endinfo=png_create_info_struct( png );
+
+ pngPointer=8;
pngLength=len;
- png_set_read_fn( png,data,pngReadFN );
- png_set_sig_bytes( png,8 );
- png_read_info( png,info );
- png_get_IHDR( png,info,&png_width,&png_height,&depth,&color,NULL,NULL,NULL );
+ png_set_read_fn( png,data,pngReadFN );
+ png_set_sig_bytes( png,8 );
+ png_read_info( png,info );
+ png_get_IHDR( png,info,&png_width,&png_height,&depth,&color,NULL,NULL,NULL );
png_set_bgr( png );
switch( info->color_type ) {
@@ -125,16 +125,16 @@
if(!mpi) return NULL;
// Let's DECODE!
- row_p=(png_bytep*)malloc( sizeof( png_bytep ) * png_height );
+ row_p=(png_bytep*)malloc( sizeof( png_bytep ) * png_height );
//png_get_rowbytes( png,info )
- for ( i=0; i < png_height; i++ ) row_p[i]=mpi->planes[0] + mpi->stride[0]*i;
- png_read_image( png,row_p );
- free( row_p );
+ for ( i=0; i < png_height; i++ ) row_p[i]=mpi->planes[0] + mpi->stride[0]*i;
+ png_read_image( png,row_p );
+ free( row_p );
//png_get_PLTE( png,info,(png_colorp*)&pal,&cols );
- png_read_end( png,endinfo );
- png_destroy_read_struct( &png,&info,&endinfo );
+ png_read_end( png,endinfo );
+ png_destroy_read_struct( &png,&info,&endinfo );
return mpi;
}
More information about the MPlayer-cvslog
mailing list