[NUT-devel] possible error in the spec for the index
Oded Shimon
ods15 at ods15.dyndns.org
Fri Nov 17 07:22:43 CET 2006
On Sun, Nov 12, 2006 at 12:33:46AM +0100, Michael Niedermayer wrote:
> Hi
>
> when trying to read the index from a libnut generated file i stumbled
> across a odd problem in how the index is stored, the problem is that
>
> from nut.txt:
> has_keyframe
> indicates whether this stream has a keyframe between this syncpoint and
> the last syncpoint.
>
> what is "this syncpoint", libnut seems to use syncpoint[0] for has_keyframe[0]
> as "this" but with that definition
> has_keyframe[0]=0 (which is harmless)
> more problematic is
> for(; j<n && j<syncpoints; j++){
>
> a keyframe after the last syncpoint would be has_keyframe[syncpoints]
> and so the pts/eor loop wouldnt be run on it -> we would know there
> is a keyframe but we dont not know its pts
>
> obvious solutions (assuiming i didnt miss something)
> 1. ignore it, its just one keyframe per stream which isnt in the index
> 2. redefine has_keyframe so [0] is for sp[0] ... sp[1]
> 3. change j<syncpoints to j<syncpoints+1
I'm mostly leaning to 1. Otherwise, I preffer 2.
3 has a small issue of describing more syncpoints than there are in the
file, or told about in the index (in the first loop). 3 has the
slight advantage of being backwards compatible in careful demuxers...
- ods15
More information about the NUT-devel
mailing list