Logo Search packages:      
Sourcecode: libtheora version File versions  Download package

void theora_comment_add ( theora_comment tc,
char *  comment 
)

Add a comment to an initialized theora_comment structure

Parameters:
tcA previously initialized theora comment structure
commentA null-terminated string encoding the comment in the form "TAG=the value"

Neither theora_comment_add() nor theora_comment_add_tag() support comments containing null values, although the bitstream format supports this. To add such comments you will need to manipulate the theora_comment structure directly.

Definition at line 27 of file comment.c.

References theora_comment::comment_lengths, theora_comment::comments, theora_comment_add(), and theora_comment::user_comments.

Referenced by theora_comment_add(), and theora_comment_add_tag().

                                                         {
  tc->user_comments=_ogg_realloc(tc->user_comments,
                            (tc->comments+2)*sizeof(*tc->user_comments));
  tc->comment_lengths=_ogg_realloc(tc->comment_lengths,
                            (tc->comments+2)*sizeof(*tc->comment_lengths));
  tc->comment_lengths[tc->comments]=strlen(comment);
  tc->user_comments[tc->comments]=_ogg_malloc(tc->comment_lengths[tc->comments]+1);
  strcpy(tc->user_comments[tc->comments], comment);
  tc->comments++;
  tc->user_comments[tc->comments]=NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index