+ if (h->sei_display_orientation_present &&
+ (h->sei_anticlockwise_rotation || h->sei_hflip || h->sei_vflip)) {
+ double angle = h->sei_anticlockwise_rotation * 360 / (double) (1 << 16);
+ AVFrameSideData *rotation = av_frame_new_side_data(&cur->f,
+ AV_FRAME_DATA_DISPLAYMATRIX,
+ sizeof(int32_t) * 9);
+ if (!rotation)
+ return;
+
+ av_display_rotation_set((int32_t *)rotation->data, angle);
+ av_display_matrix_flip((int32_t *)rotation->data,
+ h->sei_vflip, h->sei_hflip);
+ }
+