add support for APPLICATION block
authorJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 14 Jun 2001 18:57:05 +0000 (18:57 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 14 Jun 2001 18:57:05 +0000 (18:57 +0000)
src/libFLAC/stream_encoder_framing.c

index c187245..e463006 100644 (file)
@@ -81,6 +81,20 @@ bool FLAC__add_metadata_block(const FLAC__StreamMetaData *metadata, FLAC__BitBuf
                        if(!FLAC__bitbuffer_write_zeroes(bb, metadata->length * 8))
                                return false;
                        break;
+               case FLAC__METADATA_TYPE_APPLICATION:
+                       if(!FLAC__bitbuffer_write_raw_uint32(bb, metadata->data.application.id[0], 8))
+                               return false;
+                       if(!FLAC__bitbuffer_write_raw_uint32(bb, metadata->data.application.id[1], 8))
+                               return false;
+                       if(!FLAC__bitbuffer_write_raw_uint32(bb, metadata->data.application.id[2], 8))
+                               return false;
+                       if(!FLAC__bitbuffer_write_raw_uint32(bb, metadata->data.application.id[3], 8))
+                               return false;
+                       for(i = 0; i < metadata->length; i++) {
+                               if(!FLAC__bitbuffer_write_raw_uint32(bb, metadata->data.application.data[i], 8))
+                                       return false;
+                       }
+                       break;
                case FLAC__METADATA_TYPE_SEEKTABLE:
                        for(i = 0; i < metadata->data.seek_table.num_points; i++) {
                                if(!FLAC__bitbuffer_write_raw_uint64(bb, metadata->data.seek_table.points[i].sample_number, FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN))