Don't wrtie to the page we have mmaped read only.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 14 Dec 2001 12:15:27 +0000 (12:15 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 14 Dec 2001 12:15:27 +0000 (12:15 +0000)
Original commit message from CVS:
Don't wrtie to the page we have mmaped read only.

gst/elements/gstfilesrc.c
plugins/elements/gstfilesrc.c

index f6843e1..c2f0f53 100644 (file)
@@ -511,8 +511,9 @@ gst_filesrc_get (GstPad *pad)
 
   /* if we need to touch the buffer (to bring it into memory), do so */
   if (src->touch) {
+    volatile guchar *p = GST_BUFFER_DATA (buf), c;
     for (i=0;i<GST_BUFFER_SIZE(buf);i+=src->pagesize)
-      *(GST_BUFFER_DATA(buf)+i) = *(GST_BUFFER_DATA(buf)+i);
+      c = p[i];
   }
 
   /* we're done, return the buffer */
index f6843e1..c2f0f53 100644 (file)
@@ -511,8 +511,9 @@ gst_filesrc_get (GstPad *pad)
 
   /* if we need to touch the buffer (to bring it into memory), do so */
   if (src->touch) {
+    volatile guchar *p = GST_BUFFER_DATA (buf), c;
     for (i=0;i<GST_BUFFER_SIZE(buf);i+=src->pagesize)
-      *(GST_BUFFER_DATA(buf)+i) = *(GST_BUFFER_DATA(buf)+i);
+      c = p[i];
   }
 
   /* we're done, return the buffer */