Skip to content
Snippets Groups Projects
Commit ab622831 authored by Oliver Fromme's avatar Oliver Fromme Committed by Michael Niedermayer
Browse files

avcodec/dvdsubenc: accept forced flag

parent d43c3030
No related branches found
No related tags found
No related merge requests found
...@@ -259,6 +259,7 @@ static int encode_dvd_subtitles(AVCodecContext *avctx, ...@@ -259,6 +259,7 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
AVSubtitleRect vrect; AVSubtitleRect vrect;
uint8_t *vrect_data = NULL; uint8_t *vrect_data = NULL;
int x2, y2; int x2, y2;
int forced = 0;
if (rects == 0 || h->rects == NULL) if (rects == 0 || h->rects == NULL)
return AVERROR(EINVAL); return AVERROR(EINVAL);
...@@ -267,6 +268,12 @@ static int encode_dvd_subtitles(AVCodecContext *avctx, ...@@ -267,6 +268,12 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Bitmap subtitle required\n"); av_log(avctx, AV_LOG_ERROR, "Bitmap subtitle required\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
/* Mark this subtitle forced if any of the rectangles is forced. */
for (i = 0; i < rects; i++)
if ((h->rects[i]->flags & AV_SUBTITLE_FLAG_FORCED) != 0) {
forced = 1;
break;
}
vrect = *h->rects[0]; vrect = *h->rects[0];
if (rects > 1) { if (rects > 1) {
...@@ -371,7 +378,7 @@ static int encode_dvd_subtitles(AVCodecContext *avctx, ...@@ -371,7 +378,7 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
bytestream_put_be16(&q, offset1); bytestream_put_be16(&q, offset1);
bytestream_put_be16(&q, offset2); bytestream_put_be16(&q, offset2);
*q++ = 0x01; // start command *q++ = forced ? 0x00 : 0x01; // start command
*q++ = 0xff; // terminating command *q++ = 0xff; // terminating command
// send stop display command last // send stop display command last
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment