view TOOLS/midentify.sh @ 32938:29ce708287dd

Reduce item arrays to reasonable size. The current maximum of items used in skins is 46 (for main), 27 (for bar) and 15 (for menu), so 64 seems to be a reasonable value. The symbolic constant will allow to check for out-of-bounds array access later (which currently isn't performed) and issue an appropriate error message.
author ib
date Fri, 04 Mar 2011 13:58:48 +0000
parents 305dc504c407
children 877e37095c2d
line wrap: on
line source

#!/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
	                }'