[MPlayer-users] Re: xvid and mencoder - corrupt headers?
Tobias Diedrich
ranma at tdiedrich.de
Sun Jun 6 11:03:46 CEST 2004
rcooley wrote:
> Yes, that is exactly what MPlayer does. It was mentioned on -dev that
> some AVI files can't be read if it tries to use ODML, so the default is
> to try regular AVI unless it's too big to be regular AVI.
>
> In MPlayer-1.0pre4:
>
> libmpdemux/aviheader.c: unmodified: line 228 of 713 [31%]
>
> // FIXME: do not use odml index for files that don't need it.
> // apparently the odml code is buggy!
> if (demuxer->movi_end < 0x7fffffff) break;
>
> You could change 0x7fffffff to about half that, so it will read ODML for
> 1GB+ files. Alternatively:
No, please use the attached patch.
The apparent corruption problem is a bit more tricky, because I could
not reproduce it so far and most users do not seem willing to upload
1GB+-Files... :-)
However if you could reduce the ODML_CHUNKLEN to a small value and
produce a small buggy file with that in upload it, that could help
finding the bug.
--
Tobias PGP: http://9ac7e0bc.2ya.com
Say *no* to software patents in Europe!
http://petition.eurolinux.org/ For a Software Patent Free Europe
http://www.ffii.org/ Foundation for a Free Information Infrastructure
-------------- next part --------------
--- MPlayer-1.0pre4/libmpdemux/aviheader.c 2004-04-28 01:08:46.000000000 +0200
+++ mplayer-cvs/main-vanilla/libmpdemux/aviheader.c 2004-04-30 22:37:25.000000000 +0200
@@ -225,9 +225,6 @@
DWORD i;
unsigned msize = 0;
avisuperindex_chunk *s;
- // FIXME: do not use odml index for files that don't need it.
- // apparently the odml code is buggy!
- if (demuxer->movi_end < 0x7fffffff) break;
priv->suidx_size++;
priv->suidx = realloc(priv->suidx, priv->suidx_size * sizeof (avisuperindex_chunk));
s = &priv->suidx[priv->suidx_size-1];
@@ -262,7 +259,6 @@
(s->dwChunkId), i,
(uint64_t)s->aIndex[i].qwOffset, s->aIndex[i].dwSize, s->aIndex[i].dwDuration);
}
- priv->isodml++;
break; }
case ckidSTREAMFORMAT: { // read 'strf'
@@ -401,6 +397,15 @@
if (strncmp(riff_type, "AVIX", sizeof riff_type))
mp_msg(MSGT_HEADER, MSGL_WARN,
"** warning: this is no extended AVI header..\n");
+ else {
+ /*
+ * We got an extended AVI header, so we need to switch to
+ * ODML to get seeking to work, provided we got indx chunks
+ * in the header (suidx_size > 0).
+ */
+ if (priv->suidx_size > 0)
+ priv->isodml = 1;
+ }
chunksize = 0;
list_end = 0; /* a new list will follow */
break; }
More information about the MPlayer-users
mailing list