summaryrefslogtreecommitdiffstats
path: root/ext/mpeg2enc
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-12-13 18:43:03 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-12-13 18:43:03 +0000
commitbbe38bd951b17d6af32a08fdfa6a2d48daa5c923 (patch)
treedd92cfab1775f6ab94f1a7a64a03531b4eada63e /ext/mpeg2enc
parentee37f90d5deb90c0bd0a00c2cd0c27f8434c1b32 (diff)
downloadgst-plugins-bad-bbe38bd951b17d6af32a08fdfa6a2d48daa5c923.tar.gz
gst-plugins-bad-bbe38bd951b17d6af32a08fdfa6a2d48daa5c923.tar.bz2
gst-plugins-bad-bbe38bd951b17d6af32a08fdfa6a2d48daa5c923.zip
Wrong optimization from my side. Mpeg2enc works now
Original commit message from CVS: Wrong optimization from my side. Mpeg2enc works now
Diffstat (limited to 'ext/mpeg2enc')
-rw-r--r--ext/mpeg2enc/gstmpeg2encstreamwriter.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/mpeg2enc/gstmpeg2encstreamwriter.cc b/ext/mpeg2enc/gstmpeg2encstreamwriter.cc
index 50c70cdf..ba59f3d4 100644
--- a/ext/mpeg2enc/gstmpeg2encstreamwriter.cc
+++ b/ext/mpeg2enc/gstmpeg2encstreamwriter.cc
@@ -47,8 +47,13 @@ void
GstMpeg2EncStreamWriter::PutBits (guint32 val,
gint n)
{
- /* only relevant bits */
- val &= ~(0xffffffffU << n);
+ /* only relevant bits. Note that (according to Andrew),
+ * some CPUs do bitshifts modulo wordsize (32), which
+ * means that we have to check for n != 32 before
+ * bitshifting to the relevant bits (i.e. 0xffffffff <<
+ * 32 == 0xffffffff). */
+ if (n != 32)
+ val &= ~(0xffffffffU << n);
/* write data */
while (n >= outcnt) {