[FFmpeg-cvslog] avformat: keep r_frame_rate

Michael Niedermayer git at videolan.org
Tue Mar 12 15:41:30 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 12 15:26:35 2013 +0100| [c292e340ed0835b112309629e06765c319c5eb42] | committer: Michael Niedermayer

avformat: keep r_frame_rate

This field is used and nothing equivalent exists

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/avformat.h |   27 ++++++++++++++++-----------
 libavformat/utils.c    |    6 ++++++
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 9a53905..0fc71aa 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -663,17 +663,6 @@ typedef struct AVStream {
      *             not actually used for encoding.
      */
     AVCodecContext *codec;
-#if FF_API_R_FRAME_RATE
-    /**
-     * Real base framerate of the stream.
-     * This is the lowest framerate with which all timestamps can be
-     * represented accurately (it is the least common multiple of all
-     * framerates in the stream). Note, this value is just a guess!
-     * For example, if the time base is 1/90000 and all frames have either
-     * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
-     */
-    AVRational r_frame_rate;
-#endif
     void *priv_data;
 
     /**
@@ -738,6 +727,19 @@ typedef struct AVStream {
      */
     AVPacket attached_pic;
 
+    /**
+     * Real base framerate of the stream.
+     * This is the lowest framerate with which all timestamps can be
+     * represented accurately (it is the least common multiple of all
+     * framerates in the stream). Note, this value is just a guess!
+     * For example, if the time base is 1/90000 and all frames have either
+     * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
+     *
+     * Code outside avformat should access this field using:
+     * av_stream_get/set_r_frame_rate(stream)
+     */
+    AVRational r_frame_rate;
+
     /*****************************************************************
      * All fields below this line are not part of the public API. They
      * may not be used outside of libavformat and can be changed and
@@ -875,6 +877,9 @@ typedef struct AVStream {
 
 } AVStream;
 
+AVRational av_stream_get_r_frame_rate(const AVStream *s);
+void       av_stream_set_r_frame_rate(AVStream *s, AVRational r);
+
 #define AV_PROGRAM_RUNNING 1
 
 /**
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9b44166..9491075 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -99,6 +99,12 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp)
     return timestamp;
 }
 
+#define MAKE_ACCESSORS(str, name, type, field) \
+    type av_##name##_get_##field(const str *s) { return s->field; } \
+    void av_##name##_set_##field(str *s, type v) { s->field = v; }
+
+MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
+
 /** head of registered input format linked list */
 static AVInputFormat *first_iformat = NULL;
 /** head of registered output format linked list */



More information about the ffmpeg-cvslog mailing list