summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-01-10 19:26:51 +0100
committersfan5 <sfan5@live.de>2023-01-12 22:02:07 +0100
commit1201d59f0b5b8acc93f15904b745ec342548f9c1 (patch)
tree5eba78a5fa4dd68b5c750eb2b6ab5bc76d92ffd0 /player/playloop.c
parent7b03cd367dd5416a4728ccea7e47dcd2827cbab7 (diff)
downloadmpv-1201d59f0b5b8acc93f15904b745ec342548f9c1.tar.bz2
mpv-1201d59f0b5b8acc93f15904b745ec342548f9c1.tar.xz
various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriate
In debug mode the macro causes an assertion failure. In release mode it works differently and tells the compiler that it can assume the codepath will never execute. For this reason I was conversative in replacing it, e.g. in mpv-internal code that exhausts all valid values of an enum or when a condition is clear from directly preceding code.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 8b0d017f9f..8236ec92ff 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -291,7 +291,7 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek)
if (len >= 0)
seek_pts = seek.amount * len;
break;
- default: abort();
+ default: MP_ASSERT_UNREACHABLE();
}
double demux_pts = seek_pts;
@@ -458,7 +458,7 @@ void queue_seek(struct MPContext *mpctx, enum seek_type type, double amount,
*seek = (struct seek_params){ 0 };
return;
}
- abort();
+ MP_ASSERT_UNREACHABLE();
}
void execute_queued_seek(struct MPContext *mpctx)