History

ffplay, avcodec, avformat: Don't initialize before av_packet_ref()

It already initializes the packet.

Andreas Rheinhardt committed 6 years ago

Commit 33623301 parent c52ec036 files · +7 −9Browse files

Unified · Split

6 files
  1. fftools/ffplay.c +1 −1
  2. libavcodec/qsvdec_h2645.c +1 −1
  3. libavcodec/qsvdec_other.c +1 −1
  4. libavformat/fifo.c +0 −1
  5. libavformat/img2enc.c +4 −4
  6. libavformat/tee.c +0 −1
fftools/ffplay.c+1−1
@@ -2977,7 +2977,7 @@ static int read_thread(void *arg) · 2976 unmodified lines
29772977 }
29782978 if (is->queue_attachments_req) {
29792979 if (is->video_st && is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC) {
2980− AVPacket copy = { 0 };
2980+ AVPacket copy;
29812981 if ((ret = av_packet_ref(&copy, &is->video_st->attached_pic)) < 0)
29822982 goto fail;
29832983 packet_queue_put(&is->videoq, &copy);
libavcodec/qsvdec_h2645.c+1−1
@@ -125,7 +125,7 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data, · 124 unmodified lines
125125
126126 /* buffer the input packet */
127127 if (avpkt->size) {
128− AVPacket input_ref = { 0 };
128+ AVPacket input_ref;
129129
130130 if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) {
131131 ret = av_fifo_realloc2(s->packet_fifo,
libavcodec/qsvdec_other.c+1−1
@@ -123,7 +123,7 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data, · 122 unmodified lines
123123
124124 /* buffer the input packet */
125125 if (avpkt->size) {
126− AVPacket input_ref = { 0 };
126+ AVPacket input_ref;
127127
128128 if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) {
129129 ret = av_fifo_realloc2(s->packet_fifo,
libavformat/fifo.c+0−1
@@ -536,7 +536,6 @@ static int fifo_write_packet(AVFormatContext *avf, AVPacket *pkt) · 535 unmodified lines
536536 int ret;
537537
538538 if (pkt) {
539− av_init_packet(&msg.pkt);
540539 ret = av_packet_ref(&msg.pkt,pkt);
541540 if (ret < 0)
542541 return ret;
libavformat/img2enc.c+4−4
@@ -78,7 +78,7 @@ static int write_muxed_file(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) · 77 unmodified lines
7878 VideoMuxData *img = s->priv_data;
7979 AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
8080 AVStream *st;
81− AVPacket pkt2 = {0};
81+ AVPacket pkt2;
8282 AVFormatContext *fmt = NULL;
8383 int ret;
8484
@@ -88,8 +88,8 @@ static int write_muxed_file(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) · 3 unmodified lines
8888 return ret;
8989 st = avformat_new_stream(fmt, NULL);
9090 if (!st) {
91− avformat_free_context(fmt);
92− return AVERROR(ENOMEM);
91+ ret = AVERROR(ENOMEM);
92+ goto out;
9393 }
9494 st->id = pkt->stream_index;
9595
@@ -105,8 +105,8 @@ static int write_muxed_file(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) · 9 unmodified lines
105105 (ret = av_interleaved_write_frame(fmt, &pkt2)) < 0 ||
106106 (ret = av_write_trailer(fmt))) {}
107107
108−out:
109108 av_packet_unref(&pkt2);
109+out:
110110 avformat_free_context(fmt);
111111 return ret;
112112 }
libavformat/tee.c+0−1
@@ -564,7 +564,6 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt) · 563 unmodified lines
564564 if (s2 < 0)
565565 continue;
566566
567− memset(&pkt2, 0, sizeof(AVPacket));
568567 if ((ret = av_packet_ref(&pkt2, pkt)) < 0)
569568 if (!ret_all) {
570569 ret_all = ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t