[vlc-devel] [PATCH] Added option to disable chapter generation from marks file.

Tobias Güntner fatbull at web.de
Sun Sep 25 09:59:59 CEST 2011


Am 24.09.2011 23:24, schrieb Janne Kujanpää:
> +    /*  read single cutmark from marks-file */
                 ^^^^^^
Are you sure? ;)

> +        /* Doesn't need  overflow check. 2^64 with 25FPS => 23,3*10^9 years
> +         * After cut process VDR will retain cutmarks in marks-file even parts
> +         * of the the is cut out. After processing there will be cutmarks near
> +         * each other. With VDR 1.7.20 gap between marks is 12-15 frames.
> +         * Autodetect when playing edited file and generate chaptermarks only
> +         * for odd numbered cutmarks*/

I think it is sufficient to say that you merge chapters which are too 
close. It does not matter whether they are even or odd or how they have 
been created. (Cutting isn't the only way. Sometimes noad does it, too.)

> +        if ( i_frame - i_last_frame < 45 )

What if the first cut mark is at frame 43 or earlier?
Better test if( i_last_frame >= 0 && ... )

Further, I don't like the hard-coded frame count. I would prefer a 
configurable time duration, e.g.,
     int i_min_chapter_gap = p_sys->fps *
         var_InheritInteger( p_access, "vdr-min-chapter-gap" );
I'm not sure whether it should be enabled or disabled by default, 
though. Opinions?

> +        {
> +            msg_Info( p_access, "Detected %"PRId64" frames between cutmarks. "\
> +                "Deleting previously generated chapter mark.", i_frame - i_last_frame );
> +            TAB_REMOVE( p_marks->i_seekpoint, p_marks->seekpoint, sp );
> +            vlc_seekpoint_Delete(sp);
> +        }

I think sp could be deleted twice in some cases. I suggest you simply 
"continue;" here instead and be done with it. It does not matter which 
cut mark is deleted/ignored, does it?

Regards,
Tobias




More information about the vlc-devel mailing list