diff options
author | kmkaplan <kmkaplan@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-29 03:17:57 +0000 |
---|---|---|
committer | kmkaplan <kmkaplan@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-29 03:17:57 +0000 |
commit | 4d38521e2cd1e62ef334a73624cbd4a95f1de436 (patch) | |
tree | 4062471fbc1275741c53a621d3a761176cf69d2e /spudec.c | |
parent | 7498cf71456f9b64005250c9c780797d169ba23d (diff) | |
download | mpv-4d38521e2cd1e62ef334a73624cbd4a95f1de436.tar.bz2 mpv-4d38521e2cd1e62ef334a73624cbd4a95f1de436.tar.xz |
* New command line switch for mplayer & mencoder:
-ifo <ifo file>
Indicate the file that will be used to load palette and frame size
for MPEG subtitles.
* mencoder.c:
Fix cropping when decoding MPEG2.
* spudec.c:
If scaling is needed only do it once.
Change WITH_NO_ANTIALIASING to ANTIALIASING_ALGORITHM.
* vobsub.c:
Support reading info regarding size and palette from IDX file instead of IFO file.
Support streams containing audio or video.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5389 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'spudec.c')
-rw-r--r-- | spudec.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -26,7 +26,7 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#ifndef WITH_NO_ANTIALIASING +#if ANTIALIASING_ALGORITHM == 2 #include <math.h> #endif #include "spudec.h" @@ -55,7 +55,7 @@ typedef struct { size_t image_size; /* Size of the image buffer */ unsigned char *image; /* Grayscale value */ unsigned char *aimage; /* Alpha value */ - int scaled; /* flag if the image has already been scaled */ + unsigned int scaled_frame_width, scaled_frame_height; unsigned int scaled_start_col, scaled_start_row; unsigned int scaled_width, scaled_height, scaled_stride; size_t scaled_image_size; @@ -116,7 +116,8 @@ static void spudec_process_data(spudec_handle_t *this) unsigned int cmap[4], alpha[4]; unsigned int i, x, y; - this->scaled = 0; + this->scaled_frame_width = 0; + this->scaled_frame_height = 0; for (i = 0; i < 4; ++i) { alpha[i] = mkalpha(this->alpha[i]); if (alpha[i] == 0) @@ -389,8 +390,7 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra spu->image, spu->aimage, spu->stride); } else { - if (!spu->scaled || - spu->orig_frame_width != dxs || spu->orig_frame_height != dys) { /* Resizing is needed */ + if (spu->scaled_frame_width != dxs || spu->scaled_frame_height != dys) { /* Resizing is needed */ /* scaled_x = scalex * x / 0x100 scaled_y = scaley * y / 0x100 order of operations is important because of rounding. */ @@ -642,7 +642,8 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra } } #endif - spu->scaled = 1; + spu->scaled_frame_width = dxs; + spu->scaled_frame_height = dys; } } if (spu->scaled_image) |