diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-05-13 02:58:57 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-05-13 02:58:57 +0000 |
commit | 6e9cbdc10448203e7c8b2de41447442fcc9f7bae (patch) | |
tree | 0ed465592509105fdbeab27fc12ddbb2e3590aa5 /libvo | |
parent | eafe5b7517bbf408ae1ffc936a3abe2313c3b334 (diff) | |
download | mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.bz2 mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.xz |
whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
58 files changed, 1288 insertions, 1288 deletions
diff --git a/libvo/aspecttest.c b/libvo/aspecttest.c index 9beebcf766..5fe6416fce 100644 --- a/libvo/aspecttest.c +++ b/libvo/aspecttest.c @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) { return 1; } printf("monitor_aspect: %f\n",monitor_aspect); - aspect(&w,&h,z); + aspect(&w,&h,z); printf("new size: %dx%d\n",w,h); return 0; } diff --git a/libvo/font_load.c b/libvo/font_load.c index ad2311e37a..e7d36d8a2c 100644 --- a/libvo/font_load.c +++ b/libvo/font_load.c @@ -91,13 +91,13 @@ if ((dn = malloc(i+1))){ } desc->fpath = dn; // search in the same dir as fonts.desc - + // desc->fpath=get_path("font/"); // if (stat(desc->fpath, &fstate)!=0) desc->fpath=DATADIR"/font"; - - - + + + // set up some defaults, and erase table desc->charspace=2; desc->spacewidth=12; @@ -117,7 +117,7 @@ while(fgets(sor,1020,f)){ /* skip files that look like: TTF (0x00, 0x01), PFM (0x00, 0x01), PFB * (0x80, 0x01), PCF (0x01, 0x66), fon ("MZ"), gzipped (0x1f, 0x8b) */ - + if (first) { if (!sor[0] || sor[1] == 1 || (sor[0] == 'M' && sor[1] == 'Z') || (sor[0] == 0x1f && sor[1] == 0x8b) || (sor[0] == 1 && sor[1] == 0x66)) { mp_msg(MSGT_OSD, MSGL_ERR, "%s doesn't look like a bitmap font description, ignoring.\n", fname); @@ -125,7 +125,7 @@ while(fgets(sor,1020,f)){ } first = 0; } - + p[0]=d;++pdb; while(1){ int c=*s++; @@ -143,14 +143,14 @@ while(fgets(sor,1020,f)){ } } else { if(id==c){ id=0;continue;} // idezojel - + } *d=c;d++; ec=c; } if(d==sor2) continue; // skip empty lines *d=0; - + // printf("params=%d sor=%s\n",pdb,sor); // for(i=0;i<pdb;i++) printf(" param %d = '%s'\n",i,p[i]); @@ -166,7 +166,7 @@ while(fgets(sor,1020,f)){ continue; } } - + if(strcmp(section,"[fpath]")==0){ if(pdb==1){ if (desc->fpath) @@ -174,7 +174,7 @@ while(fgets(sor,1020,f)){ desc->fpath=strdup(p[0]); continue; } - } else + } else #ifdef __AMIGAOS4__ #define FONT_PATH_SEP "" @@ -193,7 +193,7 @@ while(fgets(sor,1020,f)){ desc->fpath,p[1]); if(!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){ free(cp); - if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) + if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) goto fail_out; snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s" FONT_PATH_SEP "%s", default_dir,p[1]); @@ -214,7 +214,7 @@ while(fgets(sor,1020,f)){ desc->fpath,p[1]); if(!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){ free(cp); - if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) + if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) goto fail_out; snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s" FONT_PATH_SEP "%s", default_dir,p[1]); @@ -310,8 +310,8 @@ for(i=0;i<=fontdb;i++){ //x^=255; // invert if(x+y>255) x=255-y; // to avoid overflows - - //x=0; + + //x=0; //x=((x*f*(255-y))>>16); //x=((x*f*(255-y))>>16)+y; //x=(x*f)>>8;if(x<y) x=y; diff --git a/libvo/font_load.h b/libvo/font_load.h index 5371b54cbf..8dd494b941 100644 --- a/libvo/font_load.h +++ b/libvo/font_load.h @@ -54,13 +54,13 @@ typedef struct font_desc { #ifdef CONFIG_FREETYPE int face_cnt; - + FT_Face faces[16]; FT_UInt glyph_index[65536]; int max_width, max_height; - struct + struct { int g_r; int o_r; diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 20d673a0fc..fdc788e46f 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -138,7 +138,7 @@ static int check_font(font_desc_t *desc, float ppem, int padding, int pic_idx, int width, height; unsigned char *bbuffer; int i, uni_charmap = 1; - + error = FT_Select_Charmap(face, ft_encoding_unicode); // fprintf(stderr, "select unicode charmap: %d\n", error); @@ -207,7 +207,7 @@ static int check_font(font_desc_t *desc, float ppem, int padding, int pic_idx, ymax = (double)(face->bbox.yMax)/(double)face->units_per_EM*ppem+1; ymin = (double)(face->bbox.yMin)/(double)face->units_per_EM*ppem-1; - + width = ppem*(face->bbox.xMax-face->bbox.xMin)/face->units_per_EM+3+2*padding; if (desc->max_width < width) desc->max_width = width; width = ALIGN(width); @@ -222,7 +222,7 @@ static int check_font(font_desc_t *desc, float ppem, int padding, int pic_idx, mp_msg(MSGT_OSD, MSGL_ERR, "Something went wrong. Use the source!\n"); return -1; } - + height = ymax - ymin + 2*padding; if (height <= 0) { mp_msg(MSGT_OSD, MSGL_ERR, "Wrong bounding box, height <= 0 !\n"); @@ -231,7 +231,7 @@ static int check_font(font_desc_t *desc, float ppem, int padding, int pic_idx, if (desc->max_height < height) desc->max_height = height; desc->pic_b[pic_idx]->charheight = height; - + // fprintf(stderr, "font height2: %d\n", height); desc->pic_b[pic_idx]->baseline = ymax + padding; desc->pic_b[pic_idx]->padding = padding; @@ -239,7 +239,7 @@ static int check_font(font_desc_t *desc, float ppem, int padding, int pic_idx, desc->pic_b[pic_idx]->current_count = 0; bbuffer = NULL; - + desc->pic_b[pic_idx]->w = width; desc->pic_b[pic_idx]->h = height; desc->pic_b[pic_idx]->c = colors; @@ -261,7 +261,7 @@ static void outline( int msize) { int x, y; - + for (y = 0; y<height; y++) { for (x = 0; x<width; x++) { const int src= s[x]; @@ -494,12 +494,12 @@ void render_one_glyph(font_desc_t *desc, int c) FT_BitmapGlyph glyph; int width, height, stride, maxw, off; unsigned char *abuffer, *bbuffer; - + int const load_flags = FT_LOAD_DEFAULT; int pen_xa; int font = desc->font[c]; int error; - + // fprintf(stderr, "render_one_glyph %d\n", c); if (!desc->dynamic) return; @@ -507,7 +507,7 @@ void render_one_glyph(font_desc_t *desc, int c) if (desc->font[c] == -1) return; glyph_index = desc->glyph_index[c]; - + // load glyph error = FT_Load_Glyph(desc->faces[font], glyph_index, load_flags); if (error) { @@ -538,7 +538,7 @@ void render_one_glyph(font_desc_t *desc, int c) // fprintf(stderr, "glyph generated\n"); maxw = desc->pic_b[font]->charwidth; - + if (glyph->bitmap.width > maxw) { fprintf(stderr, "glyph too wide!\n"); } @@ -559,7 +559,7 @@ void render_one_glyph(font_desc_t *desc, int c) memset(desc->pic_b[font]->bmp+off, 0, increment); memset(desc->pic_a[font]->bmp+off, 0, increment); } - + abuffer = desc->pic_a[font]->bmp; bbuffer = desc->pic_b[font]->bmp; @@ -571,10 +571,10 @@ void render_one_glyph(font_desc_t *desc, int c) desc->pic_b[font]->baseline - glyph->top, desc->pic_b[font]->charwidth, desc->pic_b[font]->charheight, glyph->bitmap.width <= maxw ? glyph->bitmap.width : maxw); - + // fprintf(stderr, "glyph pasted\n"); FT_Done_Glyph((FT_Glyph)glyph); - + /* advance pen */ pen_xa = f266ToInt(slot->advance.x) + 2*desc->pic_b[font]->padding; if (pen_xa > maxw) pen_xa = maxw; @@ -594,7 +594,7 @@ void render_one_glyph(font_desc_t *desc, int c) desc->tables.o_size); } // fprintf(stderr, "fg: outline t = %lf\n", GetTimer()-t); - + if (desc->tables.g_r) { blur(abuffer+off, desc->tables.tmp, width, height, stride, desc->tables.gt2, desc->tables.g_r, @@ -650,19 +650,19 @@ static int prepare_font(font_desc_t *desc, FT_Face face, float ppem, int pic_idx // fprintf(stderr, "fg: w = %d, h = %d\n", desc->pic_a[pic_idx]->w, desc->pic_a[pic_idx]->h); return 0; - + } static int generate_tables(font_desc_t *desc, double thickness, double radius) { int width = desc->max_height; int height = desc->max_width; - + double A = log(1.0/base)/(radius*radius*2); int mx, my, i; double volume_diff, volume_factor = 0; unsigned char *omtp; - + desc->tables.g_r = ceil(radius); desc->tables.o_r = ceil(thickness); desc->tables.g_w = 2*desc->tables.g_r+1; @@ -683,7 +683,7 @@ static int generate_tables(font_desc_t *desc, double thickness, double radius) omtp = desc->tables.omt; desc->tables.tmp = malloc((width+1)*height*sizeof(short)); - + if (desc->tables.om==NULL || desc->tables.omt==NULL || desc->tables.tmp==NULL) { return -1; }; @@ -712,7 +712,7 @@ static int generate_tables(font_desc_t *desc, double thickness, double radius) } } } - + /* outline matrix */ for (my = 0; my<desc->tables.o_w; ++my) { for (mx = 0; mx<desc->tables.o_w; ++mx) { @@ -757,22 +757,22 @@ static int prepare_charset(char *charmap, char *encoding, FT_ULong *charset, FT_ int count = 0; int charset_size; iconv_t cd; - + // check if ucs-4 is available cd = iconv_open(charmap, charmap); if (cd==(iconv_t)-1) { mp_msg(MSGT_OSD, MSGL_ERR, "iconv doesn't know %s encoding. Use the source!\n", charmap); return -1; } - + iconv_close(cd); - + cd = iconv_open(charmap, encoding); if (cd==(iconv_t)-1) { mp_msg(MSGT_OSD, MSGL_ERR, "Unsupported encoding `%s', use iconv --list to list character sets known on your system.\n", encoding); return -1; } - + charset_size = 256 - first_char; for (i = 0; i<charset_size; ++i) { charcodes[count] = i+first_char; @@ -787,7 +787,7 @@ static int prepare_charset(char *charmap, char *encoding, FT_ULong *charset, FT_ mp_msg(MSGT_OSD, MSGL_ERR, "No characters to render!\n"); return -1; } - + return charset_size; } @@ -843,7 +843,7 @@ static font_desc_t* init_font_desc(void) memset(desc,0,sizeof(font_desc_t)); desc->dynamic = 1; - + /* setup sane defaults */ desc->name = NULL; desc->fpath = NULL; @@ -866,21 +866,21 @@ static font_desc_t* init_font_desc(void) desc->start[i] = desc->width[i] = desc->font[i] = -1; for(i = 0; i < 16; i++) desc->pic_a[i] = desc->pic_b[i] = NULL; - + return desc; } void free_font_desc(font_desc_t *desc) { int i; - + if (!desc) return; // if (!desc->dynamic) return; // some vo_aa crap, better leaking than crashing if (desc->name) free(desc->name); if (desc->fpath) free(desc->fpath); - + for(i = 0; i < 16; i++) { if (desc->pic_a[i]) { if (desc->pic_a[i]->bmp) free(desc->pic_a[i]->bmp); @@ -903,14 +903,14 @@ void free_font_desc(font_desc_t *desc) for(i = 0; i < desc->face_cnt; i++) { FT_Done_Face(desc->faces[i]); } - + free(desc); } static int load_sub_face(const char *name, int face_index, FT_Face *face) { int err = -1; - + if (name) err = FT_New_Face(library, name, face_index, face); if (err) { @@ -940,12 +940,12 @@ static int load_osd_face(FT_Face *face) int kerning(font_desc_t *desc, int prevc, int c) { FT_Vector kern; - + if (!desc->dynamic) return 0; if (prevc < 0 || c < 0) return 0; if (desc->font[prevc] != desc->font[c]) return 0; if (desc->font[prevc] == -1 || desc->font[c] == -1) return 0; - FT_Get_Kerning(desc->faces[desc->font[c]], + FT_Get_Kerning(desc->faces[desc->font[c]], desc->glyph_index[prevc], desc->glyph_index[c], ft_kerning_default, &kern); @@ -968,7 +968,7 @@ font_desc_t* read_font_desc_ft(const char *fname, int face_index, int movie_widt int charset_size; int i, j; int unicode; - + float movie_size; float subtitle_font_ppem; @@ -1065,14 +1065,14 @@ gen_osd: err = prepare_font(desc, face, osd_font_ppem, desc->face_cnt-1, OSD_CHARSET_SIZE, osd_charset, osd_charcodes, 0, subtitle_font_thickness, subtitle_font_radius); - + if (err) { mp_msg(MSGT_OSD, MSGL_ERR, MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareOSDFont); goto err_out; } err = generate_tables(desc, subtitle_font_thickness, subtitle_font_radius); - + if (err) { mp_msg(MSGT_OSD, MSGL_ERR, MSGTR_LIBVO_FONT_LOAD_FT_CannotGenerateTables); goto err_out; @@ -1108,7 +1108,7 @@ err_out: int init_freetype(void) { int err; - + /* initialize freetype */ err = FT_Init_FreeType(&library); if (err) { @@ -1126,7 +1126,7 @@ int done_freetype(void) if (!using_freetype) return 0; - + err = FT_Done_FreeType(library); if (err) { mp_msg(MSGT_OSD, MSGL_ERR, MSGTR_LIBVO_FONT_LOAD_FT_DoneFreeTypeFailed); diff --git a/libvo/geometry.c b/libvo/geometry.c index 7c6dc54087..189c351fc5 100644 --- a/libvo/geometry.c +++ b/libvo/geometry.c @@ -34,7 +34,7 @@ int geometry_xy_changed = 0; // xpos,ypos: position of the left upper corner // widw,widh: width and height of the window -// scrw,scrh: width and height of the current screen +// scrw,scrh: width and height of the current screen int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh) { int width, height, xoff, yoff, xper, yper; @@ -81,7 +81,7 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh) mp_msg(MSGT_VO, MSGL_V,"geometry set to width: %i," "height: %i, xoff: %i, yoff: %i, xper: %i, yper: %i\n", width, height, xoff, yoff, xper, yper); - + if(xper >= 0 && xper <= 100) xoff = (scrw - *widw) * ((float)xper / 100.0); if(yper >= 0 && yper <= 100) yoff = (scrh - *widh) * ((float)yper / 100.0); @@ -90,7 +90,7 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh) width, height, xoff, yoff, xper, yper); mp_msg(MSGT_VO, MSGL_V,"geometry window parameter: widw: %i," " widh: %i, scrw: %i, scrh: %i\n",*widw, *widh, scrw, scrh); - + if (xoff != INT_MIN && xpos) *xpos = xoff; if (yoff != INT_MIN && ypos) *ypos = yoff; if (width > 0 && widw) *widw = width; diff --git a/libvo/gl_common.c b/libvo/gl_common.c index b89c7fac07..b9ded01436 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -45,7 +45,7 @@ void (APIENTRY *GenBuffers)(GLsizei, GLuint *); void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *); void (APIENTRY *BindBuffer)(GLenum, GLuint); -GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); +GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); GLboolean (APIENTRY *UnmapBuffer)(GLenum); void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum); void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *); @@ -192,7 +192,7 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt, if (!gl_texfmt) gl_texfmt = &dummy3; if (!gl_format) gl_format = &dummy2; if (!gl_type) gl_type = &dummy2; - + *bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt); *gl_texfmt = 3; switch (fmt) { @@ -1440,7 +1440,7 @@ void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h, #ifdef GL_WIN32 #include "w32_common.h" /** - * \brief little helper since wglGetProcAddress definition does not fit our + * \brief little helper since wglGetProcAddress definition does not fit our * getProcAddress * \param procName name of function to look up * \return function pointer returned by wglGetProcAddress diff --git a/libvo/gl_common.h b/libvo/gl_common.h index 6f9ec6f1e3..8f9ce55dab 100644 --- a/libvo/gl_common.h +++ b/libvo/gl_common.h @@ -51,7 +51,7 @@ /** * \defgroup glextdefines OpenGL extension defines - * + * * conditionally define all extension defines used. * vendor specific extensions should be marked as such * (e.g. _NV), _ARB is not used to ease readability. @@ -374,7 +374,7 @@ void swapGlBuffers(void); extern void (APIENTRY *GenBuffers)(GLsizei, GLuint *); extern void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *); extern void (APIENTRY *BindBuffer)(GLenum, GLuint); -extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); +extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); extern GLboolean (APIENTRY *UnmapBuffer)(GLenum); extern void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum); extern void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *); diff --git a/libvo/gtf.c b/libvo/gtf.c index 4e8429fe9e..ce82d39a70 100644 --- a/libvo/gtf.c +++ b/libvo/gtf.c @@ -23,9 +23,9 @@ //Version 0.4 #include "config.h" -#include <stdio.h> -#include <stdlib.h> -#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <math.h> #include "gtf.h" #undef GTF_DEBUG @@ -52,7 +52,7 @@ static void GetRoundedConstants(GTF_constants *c) c->m = (GTF_given_constants.k / 256) * GTF_given_constants.m; } -void GTF_calcTimings(double X,double Y,double freq, int type, +void GTF_calcTimings(double X,double Y,double freq, int type, int want_margins, int want_interlace,struct VesaCRTCInfoBlock *result ) { GTF_constants c; @@ -62,37 +62,37 @@ void GTF_calcTimings(double X,double Y,double freq, int type, double total_active_pixels, ideal_duty_cycle, blanking_time, H_total_pixels; double H_freq, pixel_freq,actual_V_frame_freq; double H_sync_start, H_sync_end, H_back_porch, H_front_porch, H_sync_width; - double V_back_porch, V_front_porch, V_sync_start, V_sync_end,V_sync_width; + double V_back_porch, V_front_porch, V_sync_start, V_sync_end,V_sync_width; double ideal_H_period; GetRoundedConstants(&c); - + pixel_freq = RR = freq; /* DETERMINE IF 1/2 LINE INTERLACE IS PRESENT */ - - interlace = 0; - + + interlace = 0; + if (want_interlace) { - RR = RR * 2; + RR = RR * 2; Y=Y/2; interlace = 0.5; } - + result->Flags = 0; - + if ((Y==300)||(Y==200)||(Y==240)) { Y*=2; result->Flags = VESA_CRTC_DOUBLESCAN; /* TODO: check if mode support */ - } - + } + /* DETERMINE NUMBER OF LINES IN V MARGIN */ /* DETERMINE NUMBER OF PIXELS IN H MARGIN [pixels] */ - + margin_left = margin_right = 0; margin_top = margin_bottom = 0; - + if (want_margins) { margin_top = margin_bottom = (c.margin_width / 100) * Y; margin_left = round(( X* c.margin_width/100)/c.char_cell_granularity) \ @@ -100,31 +100,31 @@ void GTF_calcTimings(double X,double Y,double freq, int type, margin_right = margin_left; |