Free packets unconditionally after demuxing, and not only when the
packets belong to a given stream.
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
avcodec_get_frame_defaults(&frame);
got_frame = 0;
ret = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &packet);
- av_free_packet(&packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error decoding audio\n");
continue;
}
}
}
+ av_free_packet(&packet);
}
end:
avfilter_graph_free(&filter_graph);
avcodec_get_frame_defaults(&frame);
got_frame = 0;
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
- av_free_packet(&packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
break;
}
}
}
+ av_free_packet(&packet);
}
end:
avfilter_graph_free(&filter_graph);