[FFmpeg-devel] [PATCH 4/4] lavf/swf: rename some tag defines to match the specs.

Clément Bœsch ubitux at gmail.com
Fri Oct 12 01:15:25 CEST 2012


---
 libavformat/swf.h    | 10 +++++-----
 libavformat/swfdec.c |  8 ++++----
 libavformat/swfenc.c |  8 ++++----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavformat/swf.h b/libavformat/swf.h
index 3c7a932..d3497aa 100644
--- a/libavformat/swf.h
+++ b/libavformat/swf.h
@@ -55,10 +55,10 @@
 #define TAG_DEFINESOUND                  14
 #define TAG_STARTSOUND                   15
 #define TAG_DEFINEBUTTONSOUND            17
-#define TAG_STREAMHEAD                   18
-#define TAG_STREAMBLOCK                  19
+#define TAG_SOUNDSTREAMHEAD              18
+#define TAG_SOUNDSTREAMBLOCK             19
 #define TAG_DEFINEBITSLOSSLESS           20
-#define TAG_JPEG2                        21
+#define TAG_DEFINEBITSJPEG2              21
 #define TAG_DEFINESHAPE2                 22
 #define TAG_DEFINEBUTTONCXFORM           23
 #define TAG_PROTECT                      24
@@ -72,14 +72,14 @@
 #define TAG_DEFINEEDITTEXT               37
 #define TAG_DEFINESPRITE                 39
 #define TAG_FRAMELABEL                   43
-#define TAG_STREAMHEAD2                  45
+#define TAG_SOUNDSTREAMHEAD2             45
 #define TAG_DEFINEMORPHSHAPE             46
 #define TAG_DEFINEFONT2                  48
 #define TAG_EXPORTASSETS                 56
 #define TAG_IMPORTASSETS                 57
 #define TAG_ENABLEDEBUGGER               58
 #define TAG_DOINITACTION                 59
-#define TAG_VIDEOSTREAM                  60
+#define TAG_DEFINEVIDEOSTREAM            60
 #define TAG_VIDEOFRAME                   61
 #define TAG_DEFINEFONTINFO2              62
 #define TAG_ENABLEDEBUGGER2              64
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 6b8f666..d199898 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -152,7 +152,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
         tag = get_swf_tag(pb, &len);
         if (tag < 0)
             return tag;
-        if (tag == TAG_VIDEOSTREAM) {
+        if (tag == TAG_DEFINEVIDEOSTREAM) {
             int ch_id = avio_rl16(pb);
             len -= 2;
 
@@ -175,7 +175,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
             vst->codec->codec_id = ff_codec_get_id(ff_swf_codec_tags, avio_r8(pb));
             avpriv_set_pts_info(vst, 16, 256, swf->frame_rate);
             len -= 8;
-        } else if (tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2) {
+        } else if (tag == TAG_SOUNDSTREAMHEAD || tag == TAG_SOUNDSTREAMHEAD2) {
             /* streaming found */
             int sample_rate_code;
 
@@ -215,7 +215,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
                     return pkt->size;
                 }
             }
-        } else if (tag == TAG_STREAMBLOCK) {
+        } else if (tag == TAG_SOUNDSTREAMBLOCK) {
             for (i = 0; i < s->nb_streams; i++) {
                 st = s->streams[i];
                 if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) {
@@ -232,7 +232,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
             return pkt->size;
                 }
             }
-        } else if (tag == TAG_JPEG2) {
+        } else if (tag == TAG_DEFINEBITSJPEG2) {
             for (i=0; i<s->nb_streams; i++) {
                 st = s->streams[i];
                 if (st->codec->codec_id == AV_CODEC_ID_MJPEG && st->id == -2)
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index b55f1a9..fb6b160 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -309,7 +309,7 @@ static int swf_write_header(AVFormatContext *s)
         int v = 0;
 
         /* start sound */
-        put_swf_tag(s, TAG_STREAMHEAD2);
+        put_swf_tag(s, TAG_SOUNDSTREAMHEAD2);
         switch(swf->audio_enc->sample_rate) {
         case 11025: v |= 1 << 2; break;
         case 22050: v |= 2 << 2; break;
@@ -349,7 +349,7 @@ static int swf_write_video(AVFormatContext *s,
         enc->codec_id == AV_CODEC_ID_FLV1) {
         if (swf->video_frame_number == 0) {
             /* create a new video object */
-            put_swf_tag(s, TAG_VIDEOSTREAM);
+            put_swf_tag(s, TAG_DEFINEVIDEOSTREAM);
             avio_wl16(pb, VIDEO_ID);
             swf->vframes_pos = avio_tell(pb);
             avio_wl16(pb, 15000); /* hard flash player limit */
@@ -398,7 +398,7 @@ static int swf_write_video(AVFormatContext *s,
             put_swf_end_tag(s);
         }
 
-        put_swf_tag(s, TAG_JPEG2 | TAG_LONG);
+        put_swf_tag(s, TAG_DEFINEBITSJPEG2 | TAG_LONG);
 
         avio_wl16(pb, BITMAP_ID); /* ID of the image */
 
@@ -423,7 +423,7 @@ static int swf_write_video(AVFormatContext *s,
     /* streaming sound always should be placed just before showframe tags */
     if (swf->audio_enc && av_fifo_size(swf->audio_fifo)) {
         int frame_size = av_fifo_size(swf->audio_fifo);
-        put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
+        put_swf_tag(s, TAG_SOUNDSTREAMBLOCK | TAG_LONG);
         avio_wl16(pb, swf->sound_samples);
         avio_wl16(pb, 0); // seek samples
         av_fifo_generic_read(swf->audio_fifo, pb, frame_size, (void*)avio_write);
-- 
1.7.12.2



More information about the ffmpeg-devel mailing list