#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
url = filename;
filename = NULL;
} else {
- url_len = strlen(avf->filename) + strlen(filename) + 16;
+ url_len = strlen(avf->url) + strlen(filename) + 16;
if (!(url = av_malloc(url_len)))
FAIL(AVERROR(ENOMEM));
- ff_make_absolute_url(url, url_len, avf->filename, filename);
+ ff_make_absolute_url(url, url_len, avf->url, filename);
av_freep(&filename);
}
return ret;
st->r_frame_rate = source_st->r_frame_rate;
st->avg_frame_rate = source_st->avg_frame_rate;
- st->time_base = source_st->time_base;
st->sample_aspect_ratio = source_st->sample_aspect_ratio;
+ avpriv_set_pts_info(st, 64, source_st->time_base.num, source_st->time_base.den);
av_dict_copy(&st->metadata, source_st->metadata, 0);
return 0;
static int concat_read_header(AVFormatContext *avf)
{
ConcatContext *cat = avf->priv_data;
- uint8_t buf[4096];
+ AVBPrint bp;
uint8_t *cursor, *keyword;
- int ret, line = 0, i;
+ int line = 0, i;
unsigned nb_files_alloc = 0;
ConcatFile *file = NULL;
- int64_t time = 0;
+ int64_t ret, time = 0;
- while (1) {
- if ((ret = ff_get_line(avf->pb, buf, sizeof(buf))) <= 0)
- break;
+ av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
+
+ while ((ret = ff_read_line_to_bprint_overwrite(avf->pb, &bp)) >= 0) {
line++;
- cursor = buf;
+ cursor = bp.str;
keyword = get_keyword(&cursor);
if (!*keyword || *keyword == '#')
continue;
FAIL(AVERROR_INVALIDDATA);
}
}
- if (ret < 0)
+ if (ret != AVERROR_EOF && ret < 0)
goto fail;
if (!cat->nb_files)
FAIL(AVERROR_INVALIDDATA);
MATCH_ONE_TO_ONE;
if ((ret = open_file(avf, 0)) < 0)
goto fail;
+ av_bprint_finalize(&bp, NULL);
return 0;
fail:
+ av_bprint_finalize(&bp, NULL);
concat_read_close(avf);
return ret;
}