+/*
+Copyright (C) 2002-2013 DarkPlaces contributors
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#include "quakedef.h"
#include "dpvsimpledecode.h"
unsigned int info_imageBmask;
unsigned int info_imageBshift;
unsigned int info_imagesize;
+ double info_aspectratio;
// current video frame (needed because of delta compression)
int videoframenum;
s->info_imagewidth = hz_bitstream_read_short(s->framedatablocks);
s->info_imageheight = hz_bitstream_read_short(s->framedatablocks);
s->info_framerate = (double) hz_bitstream_read_int(s->framedatablocks) * (1.0 / 65536.0);
+ s->info_aspectratio = (double)s->info_imagewidth / (double)s->info_imageheight;
if (s->info_framerate > 0.0)
{
sfx_t* sfx;
FS_StripExtension(filename, wavename, namelen);
- strlcat(wavename, ".wav", namelen);
+ dp_strlcat(wavename, ".wav", namelen);
sfx = S_PrecacheSound (wavename, false, false);
if (sfx != NULL)
s->sndchan = S_StartSound (-1, 0, sfx, vec3_origin, 1.0f, 0);
video->getheight = dpvsimpledecode_getheight;
video->getframerate = dpvsimpledecode_getframerate;
video->decodeframe = dpvsimpledecode_video;
+ video->getaspectratio = dpvsimpledecode_getaspectratio;
return s;
}
return s->info_framerate;
}
+// return aspect ratio of the stream
+double dpvsimpledecode_getaspectratio(void *stream)
+{
+ dpvsimpledecodestream_t *s = (dpvsimpledecodestream_t *)stream;
+ return s->info_aspectratio;
+}
+
static int dpvsimpledecode_convertpixels(dpvsimpledecodestream_t *s, void *imagedata, int imagebytesperrow)
{
unsigned int a, x, y, width, height;