Mercurial > mplayer.hg
annotate TOOLS/subsearch.sh @ 29770:db80b9d20406
demuxer.c: Add initialization missing from previous commit
Reimar's previous commit ("Unbreak the demuxer-specific code in
video.c with e.g.") added the new field "non_interleaved" in
demux_stream structs, but this field was not initialized anywhere.
Under suitable circumstances this could cause a "Too many
video/audio packets in the buffer" error and failing playback. Fix
the problem by cleaning up the code that creates new instances of the
struct. Now fields will be initialized to 0 by default.
author | uau |
---|---|
date | Mon, 02 Nov 2009 01:40:09 +0000 |
parents | 4d8489f21983 |
children |
rev | line source |
---|---|
15587 | 1 #!/bin/sh |
2 # | |
3 # Collects all the appropriate subtitle files in a given directory and | |
16343 | 4 # its subdirectories, no matter what the filename is. |
5 # Use this together as: mplayer -sub `subsearch.sh` movie | |
15587 | 6 # Author: Alex |
7 # | |
8 | |
9 [ $1 ] && cd `dirname $1` | |
10 | |
11 _sub_names="" | |
12 | |
13 one_dir_search() { | |
14 for i in $dir/* | |
15 do | |
16 case "`echo $i | tr [:upper:] [:lower:]`" in | |
17 *.sub|*.srt|*.mps|*.txt) _sub_names="$i,$_sub_names" ;; | |
18 *) ;; | |
19 esac | |
20 done | |
21 } | |
22 | |
23 dir="." | |
24 one_dir_search | |
25 | |
26 # add subdirectories too | |
27 for dir in * | |
28 do | |
29 [ -d $dir ] && one_dir_search | |
30 done | |
31 | |
32 _len="`echo $_sub_names | wc -c`" | |
33 _len=$((_len-2)) | |
34 echo $_sub_names | cut -b -"$_len" |