[xiph-cvs] cvs commit: theora/examples player_example.c
Ralph Giles
giles at xiph.org
Mon Jun 9 05:11:03 PDT 2003
giles 03/06/09 08:11:02
Modified: examples player_example.c
Log:
Use the stride rather than the width when advancing the SDL overlay line
pointer. Corrects a display problem with the crop width was not a
multiple of 4.
Revision Changes Path
1.21 +4 -4 theora/examples/player_example.c
Index: player_example.c
===================================================================
RCS file: /usr/local/cvsroot/theora/examples/player_example.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- player_example.c 9 Jun 2003 01:45:19 -0000 1.20
+++ player_example.c 9 Jun 2003 12:11:02 -0000 1.21
@@ -12,7 +12,7 @@
function: example SDL player application; plays Ogg Theora files (with
optional Vorbis audio second stream)
- last mod: $Id: player_example.c,v 1.20 2003/06/09 01:45:19 tterribe Exp $
+ last mod: $Id: player_example.c,v 1.21 2003/06/09 12:11:02 giles Exp $
********************************************************************/
@@ -335,15 +335,15 @@
/* and crop input properly, respecting the encoded frame rect */
crop_offset=ti.offset_x+yuv.y_stride*ti.offset_y;
for(i=0;i<yuv_overlay->h;i++)
- memcpy(yuv_overlay->pixels[0]+yuv_overlay->w*i,
+ memcpy(yuv_overlay->pixels[0]+yuv_overlay->pitches[0]*i,
yuv.y+crop_offset+yuv.y_stride*i,
yuv_overlay->w);
crop_offset=(ti.offset_x/2)+(yuv.uv_stride)*(ti.offset_y/2);
for(i=0;i<yuv_overlay->h/2;i++){
- memcpy(yuv_overlay->pixels[1]+yuv_overlay->w/2*i,
+ memcpy(yuv_overlay->pixels[1]+yuv_overlay->pitches[1]*i,
yuv.v+crop_offset+yuv.uv_stride*i,
yuv_overlay->w/2);
- memcpy(yuv_overlay->pixels[2]+yuv_overlay->w/2*i,
+ memcpy(yuv_overlay->pixels[2]+yuv_overlay->pitches[2]*i,
yuv.u+crop_offset+yuv.uv_stride*i,
yuv_overlay->w/2);
}
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list