summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2021-10-25 10:49:11 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2021-11-03 14:09:27 +0100
commitc704824b45731f2400355ebe8ae0c576e19dc072 (patch)
treec9410eb47d37fa0b0d5d43af34e6998f3114d1b6 /filters
parent210767169191e19c70f9c7b63528b0d629ddbcfa (diff)
downloadmpv-c704824b45731f2400355ebe8ae0c576e19dc072.tar.bz2
mpv-c704824b45731f2400355ebe8ae0c576e19dc072.tar.xz
osdep: add MP_UNREACHABLE
This seems to work on gcc, clang and mingw as-is, but I made it conditional on __GNUC__ just in case, even though I can't figure out which compilers we care about that don't export this define. Also replace all instances of assert(0) in the code by MP_UNREACHABLE(), which is a strict improvement.
Diffstat (limited to 'filters')
-rw-r--r--filters/f_lavfi.c4
-rw-r--r--filters/f_utils.c2
-rw-r--r--filters/filter.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c
index 9e64215f39..b66bc8584b 100644
--- a/filters/f_lavfi.c
+++ b/filters/f_lavfi.c
@@ -394,7 +394,7 @@ static bool init_pads(struct lavfi *c)
} else if (pad->type == MP_FRAME_VIDEO) {
dst_filter = avfilter_get_by_name("buffersink");
} else {
- assert(0);
+ MP_UNREACHABLE();
}
if (!dst_filter)
@@ -484,7 +484,7 @@ static bool init_pads(struct lavfi *c)
params->frame_rate = av_d2q(fmt->nominal_fps, 1000000);
filter_name = "buffer";
} else {
- assert(0);
+ MP_UNREACHABLE();
}
params->time_base = pad->timebase;
diff --git a/filters/f_utils.c b/filters/f_utils.c
index 1b5b0e548e..c166e2a4db 100644
--- a/filters/f_utils.c
+++ b/filters/f_utils.c
@@ -250,7 +250,7 @@ static void fixed_aframe_size_process(struct mp_filter *f)
int in_samples = mp_aframe_get_size(p->in);
int copy = MPMIN(in_samples, p->samples - p->out_written);
if (!mp_aframe_copy_samples(p->out, p->out_written, p->in, 0, copy))
- assert(0);
+ MP_UNREACHABLE();
mp_aframe_skip_samples(p->in, copy);
p->out_written += copy;
}
diff --git a/filters/filter.c b/filters/filter.c
index cddeea0a3f..667925c43c 100644
--- a/filters/filter.c
+++ b/filters/filter.c
@@ -372,7 +372,7 @@ static struct mp_pin *find_connected_end(struct mp_pin *p)
return other;
p = other->user_conn;
}
- assert(0);
+ MP_UNREACHABLE();
}
// With p being part of a connection, create the pin_connection and set all