static void do_video_stats(OutputStream *ost, int frame_size);
static int64_t getutime(void);
+static int64_t getmaxrss(void);
static int run_as_daemon = 0;
static int64_t video_size = 0;
{
int i, j;
+ if (do_benchmark) {
+ int maxrss = getmaxrss() / 1024;
+ printf("bench: maxrss=%ikB\n", maxrss);
+ }
+
for (i = 0; i < nb_filtergraphs; i++) {
avfilter_graph_free(&filtergraphs[i]->graph);
for (j = 0; j < filtergraphs[i]->nb_inputs; j++) {
memcpy(t, new_pkt.data, new_pkt.size);
memset(t + new_pkt.size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
new_pkt.data = t;
+ new_pkt.buf = NULL;
a = 1;
} else
a = AVERROR(ENOMEM);
}
}
+#if FF_API_DEINTERLACE
static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)
{
AVCodecContext *dec;
dec = ist->st->codec;
/* deinterlace : must be done before any resize */
- if (do_deinterlace) {
+ if (FF_API_DEINTERLACE && do_deinterlace) {
int size;
/* create temporary picture */
*picture = *picture2;
*bufp = buf;
}
+#endif
static void do_subtitle_out(AVFormatContext *s,
OutputStream *ost,
av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop);
if (print_stats || is_last_report) {
- av_log(NULL, AV_LOG_INFO, "%s \r", buf);
+ if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
+ fprintf(stderr, "%s \r", buf);
+ } else
+ av_log(NULL, AV_LOG_INFO, "%s \r", buf);
fflush(stderr);
}
}
pkt->size = 0;
+#if FF_API_DEINTERLACE
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
+#endif
rate_emu_sleep(ist);
return AVERROR(EINVAL);
}
- ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !do_deinterlace;
+ ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !(FF_API_DEINTERLACE && do_deinterlace);
if (codec->type == AVMEDIA_TYPE_VIDEO && ist->dr1) {
ist->st->codec->get_buffer = codec_get_buffer;
ist->st->codec->release_buffer = codec_release_buffer;
/* init input streams */
for (i = 0; i < nb_input_streams; i++)
- if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
+ if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
+ for (i = 0; i < nb_output_streams; i++) {
+ ost = output_streams[i];
+ avcodec_close(ost->st->codec);
+ }
goto dump_format;
+ }
/* discard unused programs */
for (i = 0; i < nb_input_files; i++) {
exit(1);
ti = getutime() - ti;
if (do_benchmark) {
- int maxrss = getmaxrss() / 1024;
- printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
+ printf("bench: utime=%0.3fs\n", ti / 1000000.0);
}
exit(received_nb_signals ? 255 : 0);