It already initializes the packet.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
}
if (is->queue_attachments_req) {
if (is->video_st && is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC) {
- AVPacket copy = { 0 };
+ AVPacket copy;
if ((ret = av_packet_ref(©, &is->video_st->attached_pic)) < 0)
goto fail;
packet_queue_put(&is->videoq, ©);
/* buffer the input packet */
if (avpkt->size) {
- AVPacket input_ref = { 0 };
+ AVPacket input_ref;
if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) {
ret = av_fifo_realloc2(s->packet_fifo,
/* buffer the input packet */
if (avpkt->size) {
- AVPacket input_ref = { 0 };
+ AVPacket input_ref;
if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) {
ret = av_fifo_realloc2(s->packet_fifo,
int ret;
if (pkt) {
- av_init_packet(&msg.pkt);
ret = av_packet_ref(&msg.pkt,pkt);
if (ret < 0)
return ret;
VideoMuxData *img = s->priv_data;
AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
AVStream *st;
- AVPacket pkt2 = {0};
+ AVPacket pkt2;
AVFormatContext *fmt = NULL;
int ret;
return ret;
st = avformat_new_stream(fmt, NULL);
if (!st) {
- avformat_free_context(fmt);
- return AVERROR(ENOMEM);
+ ret = AVERROR(ENOMEM);
+ goto out;
}
st->id = pkt->stream_index;
(ret = av_interleaved_write_frame(fmt, &pkt2)) < 0 ||
(ret = av_write_trailer(fmt))) {}
-out:
av_packet_unref(&pkt2);
+out:
avformat_free_context(fmt);
return ret;
}
if (s2 < 0)
continue;
- memset(&pkt2, 0, sizeof(AVPacket));
if ((ret = av_packet_ref(&pkt2, pkt)) < 0)
if (!ret_all) {
ret_all = ret;