[SCM] libav/experimental: One-bit bitfields should probably be unsigned. Unfortunately, it is left up to the compiler on how one bit fields are treated. gcc treats one-bit bitfields as signed and allows for the -funsigned-field parameter. Other compilers (like Sun C) treat one-bit bitfields as unsigned no matter what. Patch by Erik Hovland erik hovland org

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:24:57 UTC 2013


The following commit has been merged in the experimental branch:
commit 72e043dd0fd2f216525285827531180af494b8a1
Author: Erik Hovland <erik at hovland.org>
Date:   Tue Jul 8 23:20:22 2008 +0000

    One-bit bitfields should probably be unsigned. Unfortunately, it is left
    up to the compiler on how one bit fields are treated. gcc treats one-bit
    bitfields as signed and allows for the -funsigned-field parameter. Other
    compilers (like Sun C) treat one-bit bitfields as unsigned no matter what.
    Patch by Erik Hovland erik hovland org
    
    Originally committed as revision 14131 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavdevice/audio.c b/libavdevice/audio.c
index 4fcd3af..172c5f1 100644
--- a/libavdevice/audio.c
+++ b/libavdevice/audio.c
@@ -47,7 +47,7 @@ typedef struct {
     int channels;
     int frame_size; /* in bytes ! */
     int codec_id;
-    int flip_left : 1;
+    unsigned int flip_left : 1;
     uint8_t buffer[AUDIO_BLOCK_SIZE];
     int buffer_ptr;
 } AudioData;
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index af93b7c..93ed4ae 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -160,13 +160,13 @@ typedef struct AVFormatParameters {
     enum PixelFormat pix_fmt;
     int channel; /**< used to select dv channel */
     const char *standard; /**< tv standard, NTSC, PAL, SECAM */
-    int mpeg2ts_raw:1;  /**< force raw MPEG2 transport stream output, if possible */
-    int mpeg2ts_compute_pcr:1; /**< compute exact PCR for each transport
-                                  stream packet (only meaningful if
-                                  mpeg2ts_raw is TRUE) */
-    int initial_pause:1;       /**< do not begin to play the stream
-                                  immediately (RTSP only) */
-    int prealloced_context:1;
+    unsigned int mpeg2ts_raw:1;  /**< force raw MPEG2 transport stream output, if possible */
+    unsigned int mpeg2ts_compute_pcr:1; /**< compute exact PCR for each transport
+                                            stream packet (only meaningful if
+                                            mpeg2ts_raw is TRUE) */
+    unsigned int initial_pause:1;       /**< do not begin to play the stream
+                                            immediately (RTSP only) */
+    unsigned int prealloced_context:1;
 #if LIBAVFORMAT_VERSION_INT < (53<<16)
     enum CodecID video_codec_id;
     enum CodecID audio_codec_id;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 6f36e0a..a10f5dc 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -63,8 +63,8 @@ typedef struct MpegTSSectionFilter {
     int section_index;
     int section_h_size;
     uint8_t *section_buf;
-    int check_crc:1;
-    int end_of_section_reached:1;
+    unsigned int check_crc:1;
+    unsigned int end_of_section_reached:1;
     SectionCallback *section_cb;
     void *opaque;
 } MpegTSSectionFilter;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list