/* close files */
for (i = 0; i < nb_output_files; i++) {
AVFormatContext *s = output_files[i]->ctx;
- if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
+ if (s && !(s->oformat->flags & AVFMT_NOFILE) && s->pb)
avio_close(s->pb);
avformat_free_context(s);
av_dict_free(&output_files[i]->opts);
in_picture->pts = ost->sync_opts;
+#if 1
if (!check_recording_time(ost))
+#else
+ if (ost->frame_number >= ost->max_frames)
+#endif
return;
if (s->oformat->flags & AVFMT_RAWPICTURE &&
av_rescale_q(of->start_time,
AV_TIME_BASE_Q,
ost->st->codec->time_base);
-
- if (of->start_time && filtered_frame->pts < 0) {
- av_frame_unref(filtered_frame);
- continue;
- }
}
//if (ost->source_index >= 0)
// *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold