- ((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&buf);
- // make all except background (first entry) non-transparent
- for (i = 1; i < sub->rects[0]->nb_colors; i++)
- ((uint32_t*)sub->rects[0]->pict.data[1])[i] |= 0xff000000;
+ ((uint32_t*)sub->rects[0]->data[1])[i] = bytestream_get_be24(&buf);
+
+ if (!has_alpha) {
+ // make all except background (first entry) non-transparent
+ for (i = 1; i < sub->rects[0]->nb_colors; i++)
+ ((uint32_t *)sub->rects[0]->data[1])[i] |= 0xff000000;
+ } else {
+ for (i = 0; i < sub->rects[0]->nb_colors; i++)
+ ((uint32_t *)sub->rects[0]->data[1])[i] |= *buf++ << 24;
+ }
+
+#if FF_API_AVPICTURE
+FF_DISABLE_DEPRECATION_WARNINGS
+{
+ AVSubtitleRect *rect;
+ int j;
+ rect = sub->rects[0];
+ for (j = 0; j < 4; j++) {
+ rect->pict.data[j] = rect->data[j];
+ rect->pict.linesize[j] = rect->linesize[j];
+ }
+}
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif