[FFmpeg-soc] [soc]: r662 - matroska/matroskaenc.c

Aurelien Jacobs aurel at gnuage.org
Fri Aug 10 17:20:53 CEST 2007


On Thu, 9 Aug 2007 22:14:06 -0400
David Conrad <umovimus at gmail.com> wrote:

> On Aug 9, 2007, at 9:35 PM, Aurelien Jacobs wrote:
> 
> > On Fri, 10 Aug 2007 01:37:20 +0200 (CEST)
> > conrad <subversion at mplayerhq.hu> wrote:
> >
> >> Author: conrad
> >> Date: Fri Aug 10 01:37:19 2007
> >> New Revision: 662
> >>
> >> Log:
> >> Use a MD5 hash of some frames to write the segment uid
> >>
> >>
> >> Modified:
> >>    matroska/matroskaenc.c
> >>
> >> Modified: matroska/matroskaenc.c
> >> ===================================================================== 
> >> =========
> >> --- matroska/matroskaenc.c	(original)
> >> +++ matroska/matroskaenc.c	Fri Aug 10 01:37:19 2007
> >> @@ -61,6 +63,8 @@ typedef struct MatroskaMuxContext {
> >>      mkv_seekhead    *main_seekhead;
> >>      mkv_seekhead    *cluster_seekhead;
> >>      mkv_cues        *cues;
> >> +
> >> +    struct AVMD5    *md5_ctx;
> >>  } MatroskaMuxContext;
> >>
> >>  static void put_ebml_id(ByteIOContext *pb, unsigned int id)
> >> @@ -547,6 +551,9 @@ static int mkv_write_header(AVFormatCont
> >>      ByteIOContext *pb = &s->pb;
> >>      offset_t ebml_header, segment_info;
> >>
> >> +    mkv->md5_ctx = av_mallocz(av_md5_size);
> >> +    av_md5_init(mkv->md5_ctx);
> >> +
> >>      ebml_header = start_ebml_master(pb, EBML_ID_HEADER);
> >>      put_ebml_uint   (pb, EBML_ID_EBMLVERSION        ,           1);
> >>
> >> [...]
> >>
> >>      end_ebml_master(pb, mkv->segment);
> >> +    av_free(mkv->md5_ctx);
> >>      return 0;
> >>  }
> >
> > Here, using a pointer along with av_malloc/av_free seems pointless.
> > You should probably put the struct AVMD5 directly into
> > MatroskaMuxContext (instead of a pointer), and remove the
> > av_malloc/av_free.
> 
> Unfortunately I don't think this is possible because the AVMD5 struct  
> definition is private to md5.c.

Ah, I missed this. You're right.

Aurel



More information about the FFmpeg-soc mailing list