summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-10-21 21:40:24 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-10-21 21:40:24 +0000
commit37d3e0667abd01124d783f3ca10a4aef05746a2a (patch)
tree284c171f9546a8f4dc4c12878ecb1c8333f63a76 /libavdevice
parent03092e14089e086065bf05671260347ad94a6262 (diff)
uses FF_ARRAY_ELEMS() where appropriate
Originally committed as revision 15662 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/v4l.c2
-rw-r--r--libavdevice/v4l2.c6
-rw-r--r--libavdevice/vfwcap.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c
index b58de94738..a469ae0135 100644
--- a/libavdevice/v4l.c
+++ b/libavdevice/v4l.c
@@ -78,7 +78,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
struct video_audio audio;
struct video_picture pict;
int j;
- int vformat_num = sizeof(video_formats) / sizeof(video_formats[0]);
+ int vformat_num = FF_ARRAY_ELEMS(video_formats);
if (ap->width <= 0 || ap->height <= 0) {
av_log(s1, AV_LOG_ERROR, "Wrong size (%dx%d)\n", ap->width, ap->height);
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index d8d58f06bd..dc0a22d9ba 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -221,7 +221,7 @@ static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt)
{
int i;
- for (i = 0; i < sizeof(fmt_conversion_table) / sizeof(struct fmt_map); i++) {
+ for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
if (fmt_conversion_table[i].ff_fmt == pix_fmt) {
return fmt_conversion_table[i].v4l2_fmt;
}
@@ -234,7 +234,7 @@ static enum PixelFormat fmt_v4l2ff(uint32_t pix_fmt)
{
int i;
- for (i = 0; i < sizeof(fmt_conversion_table) / sizeof(struct fmt_map); i++) {
+ for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
if (fmt_conversion_table[i].v4l2_fmt == pix_fmt) {
return fmt_conversion_table[i].ff_fmt;
}
@@ -563,7 +563,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
} else {
done = 1;
}
- if (i == sizeof(fmt_conversion_table) / sizeof(struct fmt_map)) {
+ if (i == FF_ARRAY_ELEMS(fmt_conversion_table)) {
done = 1;
}
}
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
index 1bab834db2..078c18668c 100644
--- a/libavdevice/vfwcap.c
+++ b/libavdevice/vfwcap.c
@@ -152,7 +152,7 @@ static int shall_we_drop(struct vfw_ctx *ctx)
{
AVFormatContext *s = ctx->s;
const uint8_t dropscore[] = {62, 75, 87, 100};
- const int ndropscores = sizeof(dropscore)/sizeof(dropscore[0]);
+ const int ndropscores = FF_ARRAY_ELEMS(dropscore);
unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
if(dropscore[++ctx->frame_num%ndropscores] <= buffer_fullness) {