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().

Originally committed as revision 13262 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2008-05-23 13:14:11 +00:00
parent fbabf1e944
commit 5c37f43a0d
3 changed files with 8 additions and 5 deletions

View File

@@ -2234,7 +2234,7 @@ void av_set_program_name(AVProgram *program, char *provider_name, char *name)
}
}
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 @@ int ff_new_chapter(AVFormatContext *s, int id, int64_t start, int64_t end, const
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 @@ int ff_new_chapter(AVFormatContext *s, int id, int64_t start, int64_t end, const
chapter->start = start;
chapter->end = end;
return 0;
return chapter;
}
/************************************************************/