Mercurial > libavformat.hg
diff utils.c @ 3330:374e74567a4e libavformat
Make ff_new_chapter() return AVChapter instead of int so its consistant with
av_new_program() and its simpler to set other fields in AVChapter which arent
set by ff_new_chapter().
| author | michael |
|---|---|
| date | Fri, 23 May 2008 13:14:11 +0000 |
| parents | b228cfb5a4f5 |
| children | 74e2cfc79cda |
line wrap: on
line diff
--- a/utils.c Fri May 23 13:08:44 2008 +0000 +++ b/utils.c Fri May 23 13:14:11 2008 +0000 @@ -2234,7 +2234,7 @@ } } -int ff_new_chapter(AVFormatContext *s, int id, int64_t start, int64_t end, const char *title) +AVChapter *ff_new_chapter(AVFormatContext *s, int id, int64_t start, int64_t end, const char *title) { AVChapter *chapter = NULL; int i; @@ -2246,7 +2246,7 @@ if(!chapter){ chapter= av_mallocz(sizeof(AVChapter)); if(!chapter) - return AVERROR(ENOMEM); + return NULL; dynarray_add(&s->chapters, &s->nb_chapters, chapter); } if(chapter->title) @@ -2256,7 +2256,7 @@ chapter->start = start; chapter->end = end; - return 0; + return chapter; } /************************************************************/
