[Mplayer-cvslog] CVS: main cfg-mplayer.h,1.81,1.82 dec_video.c,1.41,1.42 stheader.h,1.15,1.16 cfgparser.c,1.26,1.27
Atmosfear
atmos4 at mplayer.dev.hu
Mon Oct 1 17:58:33 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv30934
Modified Files:
cfg-mplayer.h dec_video.c stheader.h cfgparser.c
Log Message:
New aspect prescale code, parses aspect value from mpeg sequence header or commandline.
Removed X11_FULLSCREEN hack from mplayer.c and moved it to libvo/vo_xv.c.
Added support for nominator[:/]denominator float values in cfg-parser, thanks for the code by Steve Davies.
All around thanks to Steve for helping me understanding the whole stuff :)
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- cfg-mplayer.h 21 Sep 2001 22:32:58 -0000 1.81
+++ cfg-mplayer.h 1 Oct 2001 15:58:17 -0000 1.82
@@ -210,6 +210,7 @@
{"x", &screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096},
{"y", &screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096},
{"xy", &screen_size_xy, CONF_TYPE_INT, CONF_RANGE, 0, 4096},
+ {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0},
{"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1},
{"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0},
{"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1},
Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- dec_video.c 29 Sep 2001 21:39:56 -0000 1.41
+++ dec_video.c 1 Oct 2001 15:58:17 -0000 1.42
@@ -673,6 +673,26 @@
return 0;
}
}
+ // fill aspect info:
+ switch(picture->aspect_ratio_information){
+ case 2: // PAL/NTSC SVCD/DVD 4:3
+ case 8: // PAL VCD 4:3
+ case 12: // NTSC VCD 4:3
+ sh_video->aspect=4.0/3.0;
+ break;
+ case 3: // PAL/NTSC Widescreen SVCD/DVD 16:9
+ sh_video->aspect=16.0/9.0;
+ break;
+ default:
+ fprintf(stderr,"Detected unknown aspect_ratio_information in mpeg sequence header.\n"
+ "Please report the aspect value (%i) along with the movie type (VGA,PAL,NTSC,"
+ "SECAM) and the movie resolution (720x576,352x240,480x480,...) to the MPlayer"
+ " developers, so that we can add support for it!\nAssuming 1:1 aspect for now.\n",
+ picture->aspect_ratio_information);
+ case 1: // VGA 1:1
+ sh_video->aspect=1.0;
+ break;
+ }
// display info:
sh_video->format=picture->mpeg1?0x10000001:0x10000002; // mpeg video
sh_video->fps=frameratecode2framerate[picture->frame_rate_code]*0.0001f;
Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/stheader.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- stheader.h 1 Sep 2001 19:44:48 -0000 1.15
+++ stheader.h 1 Oct 2001 15:58:17 -0000 1.16
@@ -75,6 +75,7 @@
int i_bps; // == bitrate (compressed bytes/sec)
int disp_w,disp_h; // display size (filled by fileformat parser)
// int coded_w,coded_h; // coded size (filled by video codec)
+ float aspect;
unsigned int outfmtidx;
// unsigned int bitrate;
// buffers:
Index: cfgparser.c
===================================================================
RCS file: /cvsroot/mplayer/main/cfgparser.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- cfgparser.c 22 Aug 2001 19:29:47 -0000 1.26
+++ cfgparser.c 1 Oct 2001 15:58:17 -0000 1.27
@@ -152,8 +152,14 @@
goto err_missing_param;
tmp_float = strtod(param, &endptr);
+
+ if ((*endptr == ':') || (*endptr == '/'))
+ tmp_float /= strtod(endptr+1, &endptr);
+
if (*endptr) {
- printf("parameter must be a floating point number:\n");
+ printf("parameter must be a floating point number"
+ " or a ratio (numerator[:/]denominator):\n");
+
ret = ERR_MISSING_PARAM;
goto out;
}
More information about the MPlayer-cvslog
mailing list