av_freep(&ost->avfilter);
av_freep(&ost->logfile_prefix);
+ av_freep(&ost->audio_channels_map);
+ ost->audio_channels_mapped = 0;
+
avcodec_free_context(&ost->enc_ctx);
av_freep(&output_streams[i]);
a = AVERROR(ENOMEM);
}
if (a > 0) {
+ pkt->side_data = NULL;
+ pkt->side_data_elems = 0;
av_free_packet(pkt);
new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,
av_buffer_default_free, NULL, 0);
if (!ist->saw_first_ts) {
ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
ist->pts = 0;
- if (pkt != NULL && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
+ if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q);
ist->pts = ist->dts; //unused but better to set it to a value thats not totally wrong
}
if (ist->next_pts == AV_NOPTS_VALUE)
ist->next_pts = ist->pts;
- if (pkt == NULL) {
+ if (!pkt) {
/* EOF handling */
av_init_packet(&avpkt);
avpkt.data = NULL;