History

avcodec/mpeg12dec: respect side data preference

We only need to consider side data types that may possibly come from the packet.

Niklas Haas committed 2 years ago

Commit ffb8dc71 parent ed3cc8f1 file · +19 −19Browse files

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

Unified · Split

libavcodec/mpeg12dec.c+19−19
@@ -1306,20 +1306,20 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 1305 unmodified lines
1306 }1306 }
1307 }1307 }
1308 1308
1309 pan_scan = av_frame_new_side_data(s->current_picture_ptr->f,1309 ret = ff_frame_new_side_data(s->avctx, s->current_picture_ptr->f,
1310 AV_FRAME_DATA_PANSCAN,1310 AV_FRAME_DATA_PANSCAN, sizeof(s1->pan_scan),
1311 sizeof(s1->pan_scan));1311 &pan_scan);
1312 if (!pan_scan)1312 if (ret < 0)
1313 return AVERROR(ENOMEM);1313 return ret;
1314 memcpy(pan_scan->data, &s1->pan_scan, sizeof(s1->pan_scan));1314 if (pan_scan)
1315 memcpy(pan_scan->data, &s1->pan_scan, sizeof(s1->pan_scan));
1315 1316
1316 if (s1->a53_buf_ref) {1317 if (s1->a53_buf_ref) {
1317 AVFrameSideData *sd = av_frame_new_side_data_from_buf(1318 ret = ff_frame_new_side_data_from_buf(
1318 s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,1319 s->avctx, s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
1319 s1->a53_buf_ref);1320 &s1->a53_buf_ref, NULL);
1320 if (!sd)1321 if (ret < 0)
1321 av_buffer_unref(&s1->a53_buf_ref);1322 return ret;
1322 s1->a53_buf_ref = NULL;
1323 }1323 }
1324 1324
1325 if (s1->has_stereo3d) {1325 if (s1->has_stereo3d) {
@@ -1332,13 +1332,13 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 6 unmodified lines
1332 }1332 }
1333 1333
1334 if (s1->has_afd) {1334 if (s1->has_afd) {
1335 AVFrameSideData *sd =1335 AVFrameSideData *sd;
1336 av_frame_new_side_data(s->current_picture_ptr->f,1336 ret = ff_frame_new_side_data(s->avctx, s->current_picture_ptr->f,
1337 AV_FRAME_DATA_AFD, 1);1337 AV_FRAME_DATA_AFD, 1, &sd);
1338 if (!sd)1338 if (ret < 0)
1339 return AVERROR(ENOMEM);1339 return ret;
1340 1340 if (sd)
1341 *sd->data = s1->afd;1341 *sd->data = s1->afd;
1342 s1->has_afd = 0;1342 s1->has_afd = 0;
1343 }1343 }
1344 1344

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