]> git.phdru.name Git - audio-cdr-video.git/commitdiff
Join codecs' if's into one if/elif/else operator
authorOleg Broytman <phd@phdru.name>
Tue, 4 Nov 2014 13:24:32 +0000 (16:24 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 4 Nov 2014 13:24:32 +0000 (16:24 +0300)
video/ff_encode

index 6c29a10f61d6e75d45720c20481fa6cb513b558b..cb20f956c2e9d162fe3f71ba4dc6610cd28ac4f8 100755 (executable)
@@ -41,30 +41,29 @@ fi
 
 if [ "$vcodec" = mpeg4 ]; then
    vopts="-g 300 -bf 2"
-fi
 
-if [ "$vcodec" = mpeg4-hq ]; then
+elif [ "$vcodec" = mpeg4-hq ]; then
    vcodec=mpeg4
    vopts="-g 300 -bf 2 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2"
-fi
 
-if [ "$vcodec" = mpeg4-vhq ]; then
+elif [ "$vcodec" = mpeg4-vhq ]; then
    vcodec=mpeg4
    vopts="-g 200 -bf 2 -mbd rd -flags +mv4+aic+qprd+mv0 -flags2 skiprd -trellis 2 -cmp 2 -subcmp 2"
-fi
 
-if [ "$vcodec" = x264 ]; then
+elif [ "$vcodec" = x264 ]; then
    vcodec=libx264
-fi
 
-if [ "$vcodec" = x264-hq ]; then
+elif [ "$vcodec" = x264-hq ]; then
    vcodec=libx264
    vopts="-preset slow"
-fi
 
-if [ "$vcodec" = x264-vhq ]; then
+elif [ "$vcodec" = x264-vhq ]; then
    vcodec=libx264
    vopts="-preset veryslow"
+
+else
+   echo "Unknown video codec $vcodec; known codecs are {mpeg4,x264}[-[v]hq], copy" >&2
+   exit 1
 fi
 
 if [ "$pass" -eq 1 ]; then