Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. #############################################################################
  2. # contains_item ${needle} ${haystack[@]}
  3. #############################################################################
  4. contains_item() {
  5. set +x
  6. local ITEM=$1
  7. local LIST=${@:2}
  8.  
  9. for ELEM in ${LIST[@]}
  10. do
  11. #echo "Scanning for needle:${ITEM}: currently @ ${ELEM}"
  12. if [ ${ITEM} == ${ELEM} ]; then
  13. #echo "Found ${ITEM} == ${ELEM}"
  14. return 0
  15. fi
  16. done
  17. #echo "Did not find ${ITEM}"
  18. return 1
  19. }
  20. #############################################################################
  21. #
  22. # Example: We want to populate --enable-decoder= and --disable-decoder= flags
  23. # to invoke a ./configure script, the script gives us the list of all decoders available
  24. # we we want to exclude the ones in a given list
  25. #
  26. # ENABLED_DECODERS=(flv h263 h263i h264 hevc mpeg1video mpeg2video mpeg4 svq1 svq3 vp6 vp8 vp9 wmv1 wmv2 aac ac3 flac mp3 mp3 vorbis wmav1 wmav2 adpcm_g726)
  27. # AVAILABLE_DECODERS=`./configure --list-decoders` # We get all the available decoders
  28. #
  29. # DISABLED_DECODERS_FLAGS="" # We'll store the final decoders to disable here
  30. #
  31. # for DECODER in ${AVAILABLE_DECODERS}
  32. # do
  33. # ENCODER_ENABLED=`contains_item ${DECODER} ${ENABLED_DECODERS[@]}`
  34. # # if we don't find it in the enabled list, we add it.
  35. # # (Yes, in bash 1 stands for false. functions return 0 when everything went fine as in errors)
  36. # if [[ ${ENCODER_ENABLED} == 1 ]]; then
  37. # echo "Disabling not found decoder: ${DECODER}"
  38. # DISABLED_DECODERS_FLAGS+="--disable-decoder=${DECODER} ";
  39. # fi
  40. # done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement