#!/bin/bash

set -e

if test -z "$1" -o -n "$2"; then
    echo "Usage: $0 FILE" >&2
    exit 1
fi

file=$1

function subst () {
    from=$1
    to=$2
    if grep -q $from $file; then
        echo "$file: $from->$to"
        perl -i -p -e "s/$from/$to/g" $file
    fi
}

subst gst_pad_alloc_buffer gst_pad_alloc_buffer_and_set_caps
