[FFmpeg-cvslog] gxf: Add a local copy of the relevant parts of the frame rate table
Martin Storsjö
git at videolan.org
Fri Oct 19 13:36:22 CEST 2012
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Oct 18 10:23:12 2012 +0300| [fc085c5b33a966ad893757ab1c4269bf829ce499] | committer: Martin Storsjö
gxf: Add a local copy of the relevant parts of the frame rate table
This avoids having to share this table across the library
boundaries.
This shared table used to be problematic, if always declaring
all exported data symbols with the dllimport attribute (even
while building that same library), since it needs to be a
link-time constant when it is used in AVCodec declarations
(in mpeg12enc.c).
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc085c5b33a966ad893757ab1c4269bf829ce499
---
libavformat/gxf.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index 04d75bd..2593c06 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -180,6 +180,18 @@ static void gxf_material_tags(AVIOContext *pb, int *len, struct gxf_stream_info
}
}
+static const AVRational frame_rate_tab[] = {
+ { 60, 1},
+ {60000, 1001},
+ { 50, 1},
+ { 30, 1},
+ {30000, 1001},
+ { 25, 1},
+ { 24, 1},
+ {24000, 1001},
+ { 0, 0},
+};
+
/**
* @brief convert fps tag value to AVRational fps
* @param fps fps value from tag
@@ -187,7 +199,7 @@ static void gxf_material_tags(AVIOContext *pb, int *len, struct gxf_stream_info
*/
static AVRational fps_tag2avr(int32_t fps) {
if (fps < 1 || fps > 9) fps = 9;
- return avpriv_frame_rate_tab[9 - fps]; // values have opposite order
+ return frame_rate_tab[fps - 1];
}
/**
More information about the ffmpeg-cvslog
mailing list