return AVERROR(ENOMEM);
if (duration != INT64_MAX) {
- ret = av_opt_set_double(ctx, "duration", (double)duration / 1e6,
+ ret = av_opt_set_int(ctx, "durationi", duration,
AV_OPT_SEARCH_CHILDREN);
}
if (ret >= 0 && start_time != AV_NOPTS_VALUE) {
- ret = av_opt_set_double(ctx, "start", (double)start_time / 1e6,
+ ret = av_opt_set_int(ctx, "starti", start_time,
AV_OPT_SEARCH_CHILDREN);
}
if (ret < 0) {
char name[255];
int ret, pad_idx = 0;
+ if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
+ return AVERROR(EINVAL);
+ }
+
if (!fr.num)
fr = av_guess_frame_rate(input_files[ist->file_index]->ctx, ist->st, NULL);
char name[255];
int ret, pad_idx = 0;
+ if (ist->st->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot connect audio filter to non audio input\n");
+ return AVERROR(EINVAL);
+ }
+
av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
1, ist->st->codec->sample_rate,