summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-07 00:49:36 +0100
committerwm4 <wm4@nowhere>2015-12-07 00:49:36 +0100
commitaaa64b879e3e54ece97e9babdd7e13127974a449 (patch)
treebaf291be340ace8753b0498566a09b54a6331f03 /video
parent159eb3f962b845c861b5f10da35fcc12e1e6cb15 (diff)
downloadmpv-aaa64b879e3e54ece97e9babdd7e13127974a449.tar.bz2
mpv-aaa64b879e3e54ece97e9babdd7e13127974a449.tar.xz
cocoa: fix recent regression
Commit 9db50c67 changed it so that the window title can now be a NULL string. Completely untested. Probably fixes #2570.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index ab2f666c3e..2cb365cc1f 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -515,10 +515,12 @@ static int cocoa_set_window_title(struct vo *vo)
void *talloc_ctx = talloc_new(NULL);
struct bstr btitle =
bstr_sanitize_utf8_latin1(talloc_ctx, bstr0(s->window_title));
- NSString *nstitle = [NSString stringWithUTF8String:btitle.start];
- if (nstitle) {
- [s->window setTitle: nstitle];
- [s->window displayIfNeeded];
+ if (btitle.start) {
+ NSString *nstitle = [NSString stringWithUTF8String:btitle.start];
+ if (nstitle) {
+ [s->window setTitle: nstitle];
+ [s->window displayIfNeeded];
+ }
}
talloc_free(talloc_ctx);
return VO_TRUE;