diff TOOLS/midentify.sh @ 27198:305dc504c407

Give all shell scripts a .sh suffix for consistency.
author diego
date Mon, 07 Jul 2008 09:30:22 +0000
parents
children 877e37095c2d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TOOLS/midentify.sh	Mon Jul 07 09:30:22 2008 +0000
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# This is a wrapper around the -identify functionality.
+# It is supposed to escape the output properly, so it can be easily
+# used in shellscripts by 'eval'ing the output of this script.
+#
+# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
+# Licensed under GNU GPL.
+
+if [ -z "$1" ]; then
+	echo "Usage: midentify.sh <file> [<file> ...]"
+	exit 1
+fi
+
+mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
+	sed -ne '/^ID_/ {
+	                  s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
+	                }'