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;
*picture = *picture2;
*bufp = buf;
}
+#endif
static void do_subtitle_out(AVFormatContext *s,
OutputStream *ost,
}
pkt->size = 0;
+#if FF_API_DEINTERLACE
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
+#endif
rate_emu_sleep(ist);
/* 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++) {