diff options
author | Marton Balint <cus@passwd.hu> | 2016-01-21 22:50:46 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2016-01-25 22:06:57 +0100 |
commit | 92f2a9dbc501f3d3423253b00fc25bb9bd330657 (patch) | |
tree | b374a837198f76c963561bd494b25678048bd6f9 | |
parent | fe4a2cbd4d220a11cc82175f4cc699a4b8e74cd0 (diff) | |
download | ffmpeg-92f2a9dbc501f3d3423253b00fc25bb9bd330657.tar.gz |
lavc/libzvbi-teletextdec: remove cmax variable
Use VBI_NB_COLORS instead.
Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r-- | libavcodec/libzvbi-teletextdec.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 4342465890..5f07761300 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -229,18 +229,16 @@ static int gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_pa { int resx = page->columns * BITMAP_CHAR_WIDTH; int resy = (page->rows - chop_top) * BITMAP_CHAR_HEIGHT; - uint8_t ci, cmax = 0; + uint8_t ci; vbi_char *vc = page->text + (chop_top * page->columns); vbi_char *vcend = page->text + (page->rows * page->columns); for (; vc < vcend; vc++) { - if (vc->opacity != VBI_TRANSPARENT_SPACE) { - cmax = VBI_NB_COLORS; + if (vc->opacity != VBI_TRANSPARENT_SPACE) break; - } } - if (cmax == 0) { + if (vc >= vcend) { av_log(ctx, AV_LOG_DEBUG, "dropping empty page %3x\n", page->pgno); sub_rect->type = SUBTITLE_NONE; return 0; @@ -261,13 +259,13 @@ static int gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_pa sub_rect->y = ctx->y_offset + chop_top * BITMAP_CHAR_HEIGHT; sub_rect->w = resx; sub_rect->h = resy; - sub_rect->nb_colors = cmax; + sub_rect->nb_colors = VBI_NB_COLORS; sub_rect->data[1] = av_mallocz(AVPALETTE_SIZE); if (!sub_rect->data[1]) { av_freep(&sub_rect->data[0]); return AVERROR(ENOMEM); } - for (ci = 0; ci < cmax; ci++) { + for (ci = 0; ci < VBI_NB_COLORS; ci++) { int r, g, b, a; r = VBI_R(page->color_map[ci]); |