From d0f896cd2d5fe415b05a8872ad1de6c29752faf7 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Sun, 1 Jun 2014 10:33:48 +0530 Subject: [PATCH] spupng subtitle offset set according to dvb spec --- src/dvb_subtitle_decoder.c | 5 +---- src/spupng_encoder.c | 6 ++++++ src/spupng_encoder.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dvb_subtitle_decoder.c b/src/dvb_subtitle_decoder.c index b73dcc61..3076032c 100644 --- a/src/dvb_subtitle_decoder.c +++ b/src/dvb_subtitle_decoder.c @@ -794,6 +794,7 @@ static void save_display_set(DVBSubContext *ctx) filename = get_spupng_filename(sp); inc_spupng_fileindex(sp); + set_spupng_offset(sp,y_pos,x_pos); pbuf = (uint8_t*) malloc(width * height); memset(pbuf, 0x0, width * height); @@ -1768,10 +1769,6 @@ static void dvbsub_parse_page_segment(void *dvb_ctx, const uint8_t *buf, delete_objects(ctx); delete_cluts(ctx); } - else if(page_state == 0) - { - - } tmp_display_list = ctx->display_list; ctx->display_list = NULL; diff --git a/src/spupng_encoder.c b/src/spupng_encoder.c index 7b68a073..6eeb95b0 100644 --- a/src/spupng_encoder.c +++ b/src/spupng_encoder.c @@ -326,4 +326,10 @@ void inc_spupng_fileindex(void *ctx) struct spupng_t *sp = (struct spupng_t *)ctx; sp->fileIndex++; } +void set_spupng_offset(void *ctx,int x,int y) +{ + struct spupng_t *sp = (struct spupng_t *)ctx; + sp->xOffset = x; + sp->yOffset = y; +} diff --git a/src/spupng_encoder.h b/src/spupng_encoder.h index 13576089..428fd187 100644 --- a/src/spupng_encoder.h +++ b/src/spupng_encoder.h @@ -31,4 +31,5 @@ void write_sputag(struct spupng_t *sp,LLONG ms_start,LLONG ms_end); void write_spucomment(struct spupng_t *sp,const char *str); char* get_spupng_filename(void *ctx); void inc_spupng_fileindex(void *ctx); +void set_spupng_offset(void *ctx,int x,int y); #endif