No subject
Mon Jul 5 14:03:39 CEST 2010
ANSI C requires that a file positioning function intervene
between output and input, unless an input operation encounters
end-of-file.
Here's a patch which fix xvid 2 passes encoding, which was broken at
least on FreeBSD :
--- xvid_vbr.c 18 Sep 2002 01:32:32 -0000 1.2
+++ xvid_vbr.c 2 Nov 2002 11:13:03 -0000
@@ -593,6 +593,7 @@
{
int c, i;
+ long pos;
vbr_control_t *state = sstate;
if(state->pass1_file == NULL)
@@ -601,7 +602,7 @@
/* Goto to the file beginning */
fseek(state->pass1_file, 0, SEEK_SET);
- /* Skip the version line and the empty line */
+ /* Skip the version line and the empty line */
c = i = 0;
do {
c = fgetc(state->pass1_file);
@@ -610,6 +611,8 @@
if(c == '\n') i++;
}while(i < 2);
+ pos = ftell( state->pass1_file );
+ fseek( state->pass1_file, pos, SEEK_SET );
/* Overwrite the frame field - safe as we have written extra spaces */
fprintf(state->pass1_file, "# frames : %.10d\n", state->nb_frames);
--
Rémi
More information about the MPlayer-dev-eng
mailing list