--- ./src/idvid.orig	2010-09-11 15:36:19.000000000 -0500
+++ ./src/idvid	2010-09-13 19:32:55.000000000 -0500
@@ -203,7 +203,7 @@
     # (ID_V(ideo), ID_A(udio), and ID_L(ength))
     # Grep out special characters ()[
     # # put the VARS in a file
-    grep "^ID_[VAL]" < "$SCRATCH_FILE"   | grep -v "[()\[]" | sed 's/$/"/;s/=/="/' > "$SCRATCH_FILE".vars
+    grep "^ID_[VAL]" < "$SCRATCH_FILE"   | grep -v "[()\[]" | gsed 's/$/"/;s/=/="/' > "$SCRATCH_FILE".vars
     # source the file to set the variables
     . "$SCRATCH_FILE".vars
     # (If you've got a problem with eval, give me an alternative that
@@ -237,17 +237,17 @@
     # Find out which channel is the video channel ( 1st )
     # TODO Do we want to worry about videos with multiple channels of video ?
     VIDEO_INFO=$(grep "Video:" "$SCRATCH_FILE")
-    ID_VIDEO_TRACKS=( $(sed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$VIDEO_INFO") )
+    ID_VIDEO_TRACKS=( $(gsed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$VIDEO_INFO") )
     ID_VIDEO_TRACK="${ID_VIDEO_TRACKS[0]}"
     # Find out what audio channels are available
     if test -n "$ID_AUDIO_ID"; then
         AUDIO_INFO=$(grep "Audio:" "$SCRATCH_FILE")
         # ID_AUDIO_ID needs "TRACKS" var to remain in columns
-        TRACKS=$(sed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$AUDIO_INFO")
+        TRACKS=$(gsed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$AUDIO_INFO")
         A_TRACKS=(${TRACKS//$'\n'/ })
         # Get hexadecimal track IDs, if present
         if grep -q "\[0x[0-9a-fA-F]*]" <<< $AUDIO_INFO; then
-            HEX_TRACKS=$(sed -r 's/Stream .*\[0x([0-9a-fA-F]*)]:.*$/\1/' <<< "$AUDIO_INFO")
+            HEX_TRACKS=$(gsed -r 's/Stream .*\[0x([0-9a-fA-F]*)]:.*$/\1/' <<< "$AUDIO_INFO")
             HEX_TRACKS=(${HEX_TRACKS//$'\n'/ })
             USE_HEX_TRACKS=:
         else
@@ -257,15 +257,15 @@
         for ((i=0; i<${#A_TRACKS[@]}; i++)); do
             CUR_CHAN=$(grep "Stream #${A_TRACKS[i]}" <<< "$AUDIO_INFO")
             A_SAMPRATES=("${A_SAMPRATES[@]}" "$(echo $CUR_CHAN | \
-                sed -r 's/.* ([0-9]+) Hz.*/\1/')")
+                gsed -r 's/.* ([0-9]+) Hz.*/\1/')")
             A_BITRATES=("${A_BITRATES[@]}" "$(echo $CUR_CHAN | \
-                sed -r 's/.* ([0-9]+) kb\/s.*/\1/')")
+                gsed -r 's/.* ([0-9]+) kb\/s.*/\1/')")
             # make sure the above is a number, else set  A_BITRATE to 0
             if ! test_is_number ${A_BITRATES[i]}; then
                 A_BITRATES[i]=0
             fi
             A_CODECS=("${A_CODECS[@]}" "$(echo $CUR_CHAN | \
-                sed -r 's/.*Audio: ([^,]+),.*/\1/')")
+                gsed -r 's/.*Audio: ([^,]+),.*/\1/')")
                 if $USE_HEX_TRACKS; then
                 MP_TRACKNUM=$((16#${HEX_TRACKS[i]}))
             else
@@ -296,7 +296,7 @@
                 if grep -q 5:1 <<<  ${AUDIO_NCH[chn]}; then
                     ID_AUDIO_NCH[chn]=6
                elif grep -q channels <<< ${AUDIO_NCH[chn]}; then
-                    ID_AUDIO_NCH[chn]=$(sed -r 's/.* ([0-9]+) channels.*/\1/' \
+                    ID_AUDIO_NCH[chn]=$(gsed -r 's/.* ([0-9]+) channels.*/\1/' \
                     <<< ${AUDIO_NCH[chn]})
                 else
                     ID_AUDIO_NCH[chn]=2
@@ -336,7 +336,7 @@
     else
         # Infer aspect ratio from width/height of mplayer playback
         MPLAYER_RES=$(grep '^VO:' "$SCRATCH_FILE" | \
-            sed -e "s/..*=> *//g" -e "s/ .*$//g")
+            gsed -e "s/..*=> *//g" -e "s/ .*$//g")
         #PLAY_WIDTH=$(echo $MPLAYER_RES | awk -F 'x' '{print $1}')
         #PLAY_HEIGHT=$(echo $MPLAYER_RES | awk -F 'x' '{print $2}')
         # patch from ML:
@@ -351,7 +351,7 @@
     fi
     # Normalized aspect ratio
     V_ASPECT_RATIO=$(echo $V_ASPECT_WIDTH | \
-    sed -r -e 's/([0-9]*)([0-9][0-9])/\1.\2:1/g')
+    gsed -r -e 's/([0-9]*)([0-9][0-9])/\1.\2:1/g')
 
     NAV_LOG="${INFILE}.nav_log"
     USE_NAVLOG=false
@@ -414,7 +414,7 @@
     fi
 
     # Use mplayer-reported length as a last resort (truncate floating-point)
-    test -z $V_DURATION && V_DURATION=$(echo $ID_LENGTH | sed 's/\.[0-9]*//')
+    test -z $V_DURATION && V_DURATION=$(echo $ID_LENGTH | gsed 's/\.[0-9]*//')
 
     # TODO: WARN if video is less than one second!
 
@@ -486,7 +486,7 @@
         echo "V_ASPECT_WIDTH=$V_ASPECT_WIDTH"
         echo "ID_VIDEO_FRAMES=$ID_VIDEO_FRAMES"
     elif $TABULAR; then
-        FILE_SIZE=$(du -Dh "$INFILE" | awk '{print $1}')
+        FILE_SIZE=$(gdu -Dh "$INFILE" | awk '{print $1}')
         echo "$INFILE||$FILE_SIZE||${ID_VIDEO_WIDTH}x${ID_VIDEO_HEIGHT}||$ID_VIDEO_FPS||$ID_VIDEO_BITRATE||$ID_AUDIO_BITRATE" >> "$TABLE"
     else
         echo $SEPARATOR
