#! /bin/sh -e
## 20_ffmpeg.dpatch by  <sam+deb@zoy.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/sam/debian/official/vlc/debian/vlc-0.7.2.final/extras/ffmpeg/configure vlc-0.7.2.final/extras/ffmpeg/configure
--- /home/sam/debian/official/vlc/debian/vlc-0.7.2.final/extras/ffmpeg/configure	2004-05-20 12:35:16.000000000 +0200
+++ vlc-0.7.2.final/extras/ffmpeg/configure	2004-07-29 17:11:45.000000000 +0200
@@ -124,6 +124,12 @@
   sh4)
     cpu="sh4"
   ;;
+  parisc|parisc64)
+    cpu="parisc"
+  ;;
+  s390)
+    cpu="s390"
+  ;;
   *)
     cpu="unknown"
   ;;
@@ -1051,6 +1057,12 @@
 elif test "$cpu" = "sh4" ; then
   echo "TARGET_ARCH_SH4=yes" >> config.mak
   echo "#define ARCH_SH4 1" >> $TMPH
+elif test "$cpu" = "parisc" ; then
+  echo "TARGET_ARCH_PARISC=yes" >> config.mak
+  echo "#define ARCH_PARISC 1" >> $TMPH
+elif test "$cpu" = "s390" ; then
+  echo "TARGET_ARCH_S390=yes" >> config.mak
+  echo "#define ARCH_S390 1" >> $TMPH
 fi
 echo "#define TUNECPU $TUNECPU" >> $TMPH
 if test "$bigendian" = "yes" ; then
diff -urNad /home/sam/debian/official/vlc/debian/vlc-0.7.2.final/extras/ffmpeg/libavcodec/Makefile vlc-0.7.2.final/extras/ffmpeg/libavcodec/Makefile
--- /home/sam/debian/official/vlc/debian/vlc-0.7.2.final/extras/ffmpeg/libavcodec/Makefile	2004-05-10 10:31:52.000000000 +0200
+++ vlc-0.7.2.final/extras/ffmpeg/libavcodec/Makefile	2004-07-29 17:11:45.000000000 +0200
@@ -205,6 +205,11 @@
 libpostproc/libpostproc.a:
 	$(MAKE) -C libpostproc
 
+ifeq ($(TARGET_ARCH_PARISC),yes)
+motion_est.o: motion_est.c
+	$(CC) $(CFLAGS) -O1 -c -o $@ $<
+endif
+
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $< 
 
diff -urNad /home/sam/debian/official/vlc/debian/vlc-0.7.2.final/extras/ffmpeg/libavcodec/svq1.c vlc-0.7.2.final/extras/ffmpeg/libavcodec/svq1.c
--- /home/sam/debian/official/vlc/debian/vlc-0.7.2.final/extras/ffmpeg/libavcodec/svq1.c	2004-05-20 12:35:25.000000000 +0200
+++ vlc-0.7.2.final/extras/ffmpeg/libavcodec/svq1.c	2004-07-29 17:11:45.000000000 +0200
@@ -970,17 +970,17 @@
             int best_vector_score= INT_MAX;
             int best_vector_sum=-999, best_vector_mean=-999;
             const int stage= count-1;
-            const int8_t *vector;
+            const int8_t *vect;
     
             for(i=0; i<16; i++){
                 int sum= codebook_sum[stage*16 + i];
                 int sqr=0;
                 int diff, mean, score;
     
-                vector = codebook + stage*size*16 + i*size;
+                vect = codebook + stage*size*16 + i*size;
     
                 for(j=0; j<size; j++){
-                    int v= vector[j];
+                    int v= vect[j];
                     sqr += (v - block[stage][j])*(v - block[stage][j]);
                 }
                 diff= block_sum[stage] - sum;
@@ -997,9 +997,9 @@
                 }
             }
             assert(best_vector_mean != -999);
-            vector= codebook + stage*size*16 + best_vector[stage]*size;
+            vect= codebook + stage*size*16 + best_vector[stage]*size;
             for(j=0; j<size; j++){
-                block[stage+1][j] = block[stage][j] - vector[j];
+                block[stage+1][j] = block[stage][j] - vect[j];
             }
             block_sum[stage+1]= block_sum[stage] - best_vector_sum;
             best_vector_score += 
