From: Mark Kendall <mkend...@mythtv.org> from https://github.com/MythTV/mythtv/commit/14bea9593c44a8cd4c7c60bb6c0e1c85147ceb07 references https://code.mythtv.org/trac/ticket/8061 --- libavcodec/avcodec.h | 4 ++++ libavcodec/dvbsubdec.c | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 77ca8dee1f..1b1eb13519 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2214,6 +2214,10 @@ typedef struct AVSubtitleRect { int w; ///< width of pict, undefined when pict is not set int h; ///< height of pict, undefined when pict is not set int nb_colors; ///< number of colors in pict, undefined when pict is not set + int display_x; ///< top left corner of region into which pict is displayed + int display_y; ///< top left corner of region into which pict is displayed + int display_w; ///< width of region into which pict is displayed + int display_h; ///< height of region into which pict is displayed /** * data+linesize for the bitmap of this subtitle. diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 36596e0064..f37689d613 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -737,15 +737,9 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou const DVBSubCLUT *clut; const uint32_t *clut_table; int i; - int offset_x=0, offset_y=0; int ret = 0; - if (display_def) { - offset_x = display_def->x; - offset_y = display_def->y; - } - /* Not touching AVSubtitles again*/ if (sub->num_rects) { avpriv_request_sample(ctx, "Different Version of Segment asked Twice"); @@ -792,10 +786,20 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou continue; rect = sub->rects[i]; - rect->x = display->x_pos + offset_x; - rect->y = display->y_pos + offset_y; + rect->x = display->x_pos; + rect->y = display->y_pos; rect->w = region->width; rect->h = region->height; + if (display_def) { + rect->display_x = display_def->x; + rect->display_y = display_def->y; + rect->display_w = display_def->width; + rect->display_h = display_def->height; + } + else { + rect->display_w = 720; + rect->display_h = 576; + } rect->nb_colors = (1 << region->depth); rect->type = SUBTITLE_BITMAP; rect->linesize[0] = region->width; -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".