aboutsummaryrefslogtreecommitdiffstats
path: root/libavcore
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-26 23:12:45 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-26 23:12:45 +0000
commitc90c80ac28d7573429bf7d739eb78fad9d9b79ab (patch)
treecdecd995b367bdd5bded864a7005d394007aa7e1 /libavcore
parentdc4a50a073191075b2093a016defcbd55b043a99 (diff)
downloadffmpeg-c90c80ac28d7573429bf7d739eb78fad9d9b79ab.tar.gz
Make VideoFrameRateAbbr contain a rational rather than two ints for
num and den. Simplify. Originally committed as revision 24523 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcore')
-rw-r--r--libavcore/parseutils.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libavcore/parseutils.c b/libavcore/parseutils.c
index 86723cd384..9a87d07e98 100644
--- a/libavcore/parseutils.c
+++ b/libavcore/parseutils.c
@@ -31,7 +31,7 @@ typedef struct {
typedef struct {
const char *abbr;
- int rate_num, rate_den;
+ AVRational rate;
} VideoRateAbbr;
static const VideoSizeAbbr video_size_abbrs[] = {
@@ -75,14 +75,14 @@ static const VideoSizeAbbr video_size_abbrs[] = {
};
static const VideoRateAbbr video_rate_abbrs[]= {
- { "ntsc", 30000, 1001 },
- { "pal", 25, 1 },
- { "qntsc", 30000, 1001 }, /* VCD compliant NTSC */
- { "qpal", 25, 1 }, /* VCD compliant PAL */
- { "sntsc", 30000, 1001 }, /* square pixel NTSC */
- { "spal", 25, 1 }, /* square pixel PAL */
- { "film", 24, 1 },
- { "ntsc-film", 24000, 1001 },
+ { "ntsc", { 30000, 1001 } },
+ { "pal", { 25, 1 } },
+ { "qntsc", { 30000, 1001 } }, /* VCD compliant NTSC */
+ { "qpal", { 25, 1 } }, /* VCD compliant PAL */
+ { "sntsc", { 30000, 1001 } }, /* square pixel NTSC */
+ { "spal", { 25, 1 } }, /* square pixel PAL */
+ { "film", { 24, 1 } },
+ { "ntsc-film", { 24000, 1001 } },
};
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
@@ -122,8 +122,7 @@ int av_parse_video_rate(AVRational *rate, const char *arg)
/* First, we check our abbreviation table */
for (i = 0; i < n; ++i)
if (!strcmp(video_rate_abbrs[i].abbr, arg)) {
- rate->num = video_rate_abbrs[i].rate_num;
- rate->den = video_rate_abbrs[i].rate_den;
+ *rate = video_rate_abbrs[i].rate;
return 0;
}