int i;
int err;
+ if (!oc || !oc->pb)
+ return AVERROR(EINVAL);
+
av_write_frame(oc, NULL); /* Flush any buffered data (fragmented mp4) */
if (write_trailer)
ret = av_write_trailer(oc);
int64_t usecs;
int64_t wrapped_val;
- if (!seg->avf)
+ if (!seg->avf || !seg->avf->pb)
return AVERROR(EINVAL);
calc_times: