[FFmpeg-devel] [PATCH]support for chapters in mkv container

Michael Niedermayer michaelni
Fri May 9 16:40:15 CEST 2008


On Fri, May 09, 2008 at 03:18:35PM +0200, Anton Khirnov wrote:
> Hi,
> attached patch adds basic support for chapters in matroska container.

the changes to matroska and the changes to avformat/utils should be in
seperate patches.


[...]
> Index: libavformat/avformat.h
> ===================================================================
> --- libavformat/avformat.h	(revision 13089)
> +++ libavformat/avformat.h	(working copy)
> @@ -22,7 +22,7 @@
>  #define FFMPEG_AVFORMAT_H
>  
>  #define LIBAVFORMAT_VERSION_MAJOR 52
> -#define LIBAVFORMAT_VERSION_MINOR 13
> +#define LIBAVFORMAT_VERSION_MINOR 14
>  #define LIBAVFORMAT_VERSION_MICRO  0
>  
>  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
> @@ -389,6 +389,11 @@
>  #define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
>                                           (streams are added dynamically) */
>  
> +typedef struct AVChapter {
> +   uint64_t start, end;
> +   char *name;
> +} AVChapter;

indention is 4 spaces in ffmpeg


> +
>  #define MAX_STREAMS 20
>  
>  /**
> @@ -514,6 +519,9 @@
>       * obtained from real-time capture devices.
>       */
>      unsigned int max_picture_buffer;
> +
> +    int num_chapters;
> +    AVChapter *chapters;

The design is bad.
First adding fields to AVChapter would always require a major version bump
this is not acceptable, see AVProgram for example.
Second i think we should come up with some simple clean and generic way to
handle metadata instead of adding dozens of identical fields to
    AVFormatContext (for per file metadata)
    AVStream (for per stream metadata)
    AVProgram (for per program metadata)
    AVChapter (for per chapter metadata)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080509/e14fc8df/attachment.pgp>



More information about the ffmpeg-devel mailing list