History

avcodec/mediacodecdec: replace memset with direct zero init

Zhao Zhili committed 1 year ago

Commit 98c28111 parent b65fece1 file · +3 −8Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mediacodecdec.c+3−8
@@ -133,14 +133,12 @@ static int h264_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format) · 132 unmodified lines
133 int i;133 int i;
134 int ret;134 int ret;
135 135
136 H264ParamSets ps;136 H264ParamSets ps = {0};
137 const PPS *pps = NULL;137 const PPS *pps = NULL;
138 const SPS *sps = NULL;138 const SPS *sps = NULL;
139 int is_avc = 0;139 int is_avc = 0;
140 int nal_length_size = 0;140 int nal_length_size = 0;
141 141
142 memset(&ps, 0, sizeof(ps));
143
144 ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,142 ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
145 &ps, &is_avc, &nal_length_size, 0, avctx);143 &ps, &is_avc, &nal_length_size, 0, avctx);
146 if (ret < 0) {144 if (ret < 0) {
@@ -199,8 +197,8 @@ static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format) · 52 unmodified lines
199 int i;197 int i;
200 int ret;198 int ret;
201 199
202 HEVCParamSets ps;200 HEVCParamSets ps = {0};
203 HEVCSEI sei;201 HEVCSEI sei = {0};
204 202
205 const HEVCVPS *vps = NULL;203 const HEVCVPS *vps = NULL;
206 const HEVCPPS *pps = NULL;204 const HEVCPPS *pps = NULL;
@@ -215,9 +213,6 @@ static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format) · 8 unmodified lines
215 int sps_data_size = 0;213 int sps_data_size = 0;
216 int pps_data_size = 0;214 int pps_data_size = 0;
217 215
218 memset(&ps, 0, sizeof(ps));
219 memset(&sei, 0, sizeof(sei));
220
221 ret = ff_hevc_decode_extradata(avctx->extradata, avctx->extradata_size,216 ret = ff_hevc_decode_extradata(avctx->extradata, avctx->extradata_size,
222 &ps, &sei, &is_nalff, &nal_length_size, 0, 1, avctx);217 &ps, &sei, &is_nalff, &nal_length_size, 0, 1, avctx);
223 if (ret < 0) {218 if (ret < 0) {

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