summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-06 20:27:20 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-10 07:42:07 +0200
commitff0e8e14c3e9d1003153324d0368735dd84cb4b7 (patch)
tree23d2efbf83f17295cc44a50ef28bfa3d28009ac7 /libavformat/utils.c
parent8550a05ece37cbb777deb221cce43b5f3345137b (diff)
avformat/utils: Move avpriv_new_chapter to demux_utils.c
It is demuxer-only: Muxers deal only with chapters given to them; they don't create any of their own. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2d5ee8f7bc..1235315986 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -694,47 +694,6 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
return program;
}
-AVChapter *avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_base,
- int64_t start, int64_t end, const char *title)
-{
- FFFormatContext *const si = ffformatcontext(s);
- AVChapter *chapter = NULL;
- int ret;
-
- if (end != AV_NOPTS_VALUE && start > end) {
- av_log(s, AV_LOG_ERROR, "Chapter end time %"PRId64" before start %"PRId64"\n", end, start);
- return NULL;
- }
-
- if (!s->nb_chapters) {
- si->chapter_ids_monotonic = 1;
- } else if (!si->chapter_ids_monotonic || s->chapters[s->nb_chapters-1]->id >= id) {
- for (unsigned i = 0; i < s->nb_chapters; i++)
- if (s->chapters[i]->id == id)
- chapter = s->chapters[i];
- if (!chapter)
- si->chapter_ids_monotonic = 0;
- }
-
- if (!chapter) {
- chapter = av_mallocz(sizeof(AVChapter));
- if (!chapter)
- return NULL;
- ret = av_dynarray_add_nofree(&s->chapters, &s->nb_chapters, chapter);
- if (ret < 0) {
- av_free(chapter);
- return NULL;
- }
- }
- av_dict_set(&chapter->metadata, "title", title, 0);
- chapter->id = id;
- chapter->time_base = time_base;
- chapter->start = start;
- chapter->end = end;
-
- return chapter;
-}
-
void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned idx)
{
AVProgram *program = NULL;