[FFmpeg-cvslog] codec_names: invoke preprocessor on avcodec.h.

Nicolas George git at videolan.org
Sat Oct 22 17:02:33 CEST 2011


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Oct 22 10:55:44 2011 +0200| [0e138745f79f9da6a28b39dbd321354fd1159068] | committer: Michael Niedermayer

codec_names: invoke preprocessor on avcodec.h.

This fixes failures when codec IDs are defined conditionally,
for example when scheduling for a major bump.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e138745f79f9da6a28b39dbd321354fd1159068
---

 libavcodec/Makefile       |    3 ++-
 libavcodec/codec_names.sh |    7 +++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 147b37f..4941b6f 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -756,5 +756,6 @@ endif
 CODEC_NAMES_SH := $(SRC_PATH)/$(SUBDIR)codec_names.sh
 AVCODEC_H      := $(SRC_PATH)/$(SUBDIR)avcodec.h
 $(SUBDIR)codec_names.h: $(CODEC_NAMES_SH) config.h $(AVCODEC_H)
-	$(M)$(CODEC_NAMES_SH) config.h $(AVCODEC_H) $@
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $(AVCODEC_H) | \
+	$(CODEC_NAMES_SH) config.h $@
 $(SUBDIR)utils.o: $(SUBDIR)codec_names.h
diff --git a/libavcodec/codec_names.sh b/libavcodec/codec_names.sh
index 167d297..0e499c9 100755
--- a/libavcodec/codec_names.sh
+++ b/libavcodec/codec_names.sh
@@ -21,8 +21,7 @@
 set -e
 
 config="$1"
-codecs="$2"
-out="$3"
+out="$2"
 test -n "$out"
 
 outval=""
@@ -63,7 +62,7 @@ parse_enum_codecid () {
   while read line; do
     case "$line" in
       "};") break;;
-      *CODEC_ID_FIRST*///*dummy*) ;;
+      *CODEC_ID_FIRST*=*) ;;
       CODEC_ID_*) define_codecid ${line%%[=,]*};;
     esac
   done
@@ -78,7 +77,7 @@ parse_avcodec_h () {
 }
 
 parse_config_h  < "$config"
-parse_avcodec_h < "$codecs"
+parse_avcodec_h # use stdin
 sed -e '/case.*:/!y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \
     -e 's/extern avcodec /extern AVCodec /' > "$out" <<EOF
 $outval



More information about the ffmpeg-cvslog mailing list