@ -3393,6 +3393,8 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
track - > tag = MKTAG ( ' t ' , ' e ' , ' x ' , ' t ' ) ;
track - > tag = MKTAG ( ' t ' , ' e ' , ' x ' , ' t ' ) ;
track - > timescale = MOV_TIMESCALE ;
track - > timescale = MOV_TIMESCALE ;
track - > enc = avcodec_alloc_context3 ( NULL ) ;
track - > enc = avcodec_alloc_context3 ( NULL ) ;
if ( ! track - > enc )
return AVERROR ( ENOMEM ) ;
track - > enc - > codec_type = AVMEDIA_TYPE_SUBTITLE ;
track - > enc - > codec_type = AVMEDIA_TYPE_SUBTITLE ;
#if 0
#if 0
// These properties are required to make QT recognize the chapter track
// These properties are required to make QT recognize the chapter track
@ -3460,6 +3462,8 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
len = strlen ( t - > value ) ;
len = strlen ( t - > value ) ;
pkt . size = len + 2 ;
pkt . size = len + 2 ;
pkt . data = av_malloc ( pkt . size ) ;
pkt . data = av_malloc ( pkt . size ) ;
if ( ! pkt . data )
return AVERROR ( ENOMEM ) ;
AV_WB16 ( pkt . data , len ) ;
AV_WB16 ( pkt . data , len ) ;
memcpy ( pkt . data + 2 , t - > value , len ) ;
memcpy ( pkt . data + 2 , t - > value , len ) ;
ff_mov_write_packet ( s , & pkt ) ;
ff_mov_write_packet ( s , & pkt ) ;