diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/video_out/video_out_none.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c index dca3b8a6c..0be48d964 100644 --- a/src/video_out/video_out_none.c +++ b/src/video_out/video_out_none.c @@ -17,11 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_none.c,v 1.9 2003/02/05 21:20:10 hadess Exp $ + * $Id: video_out_none.c,v 1.10 2003/02/05 23:30:23 guenter Exp $ * * Was originally part of toxine frontend. * ...but has now been adapted to xine coding style standards ;) - * ......what changes, impressing! + * ......what changes, impressive! */ #ifdef HAVE_CONFIG_H @@ -121,6 +121,7 @@ static void none_update_frame_format(vo_driver_t *vo_driver, vo_frame_t *vo_fram uint32_t frame_size = (width * height); if((frame->width != width) || (frame->height != height) || (frame->format != format)) { + free_framedata(frame); frame->width = width; @@ -129,13 +130,21 @@ static void none_update_frame_format(vo_driver_t *vo_driver, vo_frame_t *vo_fram switch(format) { - case XINE_IMGFMT_YV12: - frame->vo_frame.pitches[0] = 8*((width + 7) / 8); - frame->vo_frame.pitches[1] = 8*((width + 15) / 16); - frame->vo_frame.pitches[2] = 8*((width + 15) / 16); - frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height); - frame->vo_frame.base[1] = malloc(frame->vo_frame.pitches[1] * ((height+1)/2)); - frame->vo_frame.base[2] = malloc(frame->vo_frame.pitches[2] * ((height+1)/2)); + case XINE_IMGFMT_YV12: + { + int y_size, uv_size; + + frame->vo_frame.pitches[0] = 8*((width + 7) / 8); + frame->vo_frame.pitches[1] = 8*((width + 15) / 16); + frame->vo_frame.pitches[2] = 8*((width + 15) / 16); + + y_size = frame->vo_frame.pitches[0] * height; + uv_size = frame->vo_frame.pitches[1] * ((height+1)/2); + + frame->vo_frame.base[0] = malloc (y_size + 2*uv_size); + frame->vo_frame.base[1] = frame->vo_frame.base[0]+y_size; + frame->vo_frame.base[2] = frame->vo_frame.base[0]+y_size+uv_size; + } break; case XINE_IMGFMT_YUY2: |