[FFmpeg-devel] ODML index and ticket #3531
Michael Niedermayer
michaelni at gmx.at
Fri Apr 25 19:57:05 CEST 2014
On Thu, Apr 24, 2014 at 11:06:47AM -0400, Don Moir wrote:
>
> ----- Original Message ----- From: "Don Moir" <donmoir at comcast.net>
> To: "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org>
> Sent: Thursday, April 24, 2014 12:14 AM
> Subject: [FFmpeg-devel] ODML index and ticket #3531
>
>
> >referring to avidec.c
> >
> >In read_braindead_odml_indx you have this to add index entries:
> >
> >...
> > if (last_pos == pos || pos == base - 8)
> > avi->non_interleaved = 1;
> > if (last_pos != pos && (len || !ast->sample_size))
> > av_add_index_entry(st, pos, ast->cum_len, len, 0,
> > key ? AVINDEX_KEYFRAME : 0);
> >...
> >
> >for a video stream ast->sample_size is always zero it appears. In fact it is set to zero
> >
> >static int avi_read_header(AVFormatContext *s)
> >{
> > ...
> > switch (tag1) {
> > case MKTAG('v', 'i', 'd', 's'):
> > codec_type = AVMEDIA_TYPE_VIDEO;
> >
> > ast->sample_size = 0;
> > break;
> > ...
> >}
> >
> >So it seems its a bug to check blindly for ast->sample_size == 0 (!ast->sample_size) in read_braindead_odml_indx.
> >
> >Seems sample_rate is only valid for audio streams.
> >
> >http://trac.ffmpeg.org/ticket/3531
>
> If you look at ticket 3531, you will see that it creates over 11
> million index entries for the file lake.avi. These appear to be
> completely bogus. The index ends up being larger than the file.
>
> If I remove the check for !ast->sample_size and just check len, then
> you end with about 350 index entries and the file plays completely
> normal and opens in about 2 seconds. Without this, it can appear to
> be hung for a very long time.
>
> Not sure if this is the correct thing to do though. Appears there is a lot of zero len values for the file.
>
> ...
> if (last_pos == pos || pos == base - 8)
> avi->non_interleaved = 1;
> - if (last_pos != pos && (len || !ast->sample_size))
> + if (last_pos != pos && len)
> av_add_index_entry(st, pos, ast->cum_len, len, 0,
> key ? AVINDEX_KEYFRAME : 0);
> ...
applied that
seems not to break anything i tried
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140425/7f16f74a/attachment.asc>
More information about the ffmpeg-devel
mailing list