[SCM] libav/experimental: Add is_var_size and frame_or_sample_num to FLACFrameInfo and read them in ff_flac_decode_frame_header(). Patch by Michael Chinen [mchinen at gmail]

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:19:53 UTC 2013


The following commit has been merged in the experimental branch:
commit 71b6fc216c00f32f834cd49465341174e74ea3b9
Author: Michael Chinen <mchinen at gmail.com>
Date:   Tue Dec 7 13:50:13 2010 +0000

    Add is_var_size and frame_or_sample_num to FLACFrameInfo and read them in
    ff_flac_decode_frame_header().
    Patch by Michael Chinen [mchinen at gmail]
    
    Originally committed as revision 25911 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index 2e3197f..083578e 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -44,7 +44,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
     }
 
     /* variable block size stream code */
-    skip_bits1(gb);
+    fi->is_var_size = get_bits1(gb);
 
     /* block size and sample rate codes */
     bs_code = get_bits(gb, 4);
@@ -78,8 +78,9 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
     }
 
     /* sample or frame count */
-    if (get_utf8(gb) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "utf8 fscked\n");
+    fi->frame_or_sample_num = get_utf8(gb);
+    if (fi->frame_or_sample_num < 0) {
+        av_log(avctx, AV_LOG_ERROR, "sample/frame number invalid; utf8 fscked\n");
         return -1;
     }
 
diff --git a/libavcodec/flac.h b/libavcodec/flac.h
index fe38463..27f0090 100644
--- a/libavcodec/flac.h
+++ b/libavcodec/flac.h
@@ -81,6 +81,11 @@ typedef struct FLACFrameInfo {
     FLACCOMMONINFO
     int blocksize;          /**< block size of the frame                 */
     int ch_mode;            /**< channel decorrelation mode              */
+    int64_t frame_or_sample_num;    /**< frame number or sample number   */
+    int is_var_size;                /**< specifies if the stream uses variable
+                                         block sizes or a fixed block size;
+                                         also determines the meaning of
+                                         frame_or_sample_num             */
 } FLACFrameInfo;
 
 /**

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list