From d5eaf6a820d73181f07de3387cd1c115a49648f5 Mon Sep 17 00:00:00 2001
From: Uoti Urpala <uau@glyph.nonexistent.invalid>
Date: Sun, 16 Jan 2011 21:16:47 +0200
Subject: [PATCH] core: ordered chapters: fix bad subtitle parameter

mp_property_do() takes the value to set a property to through a
pointer. The calling code used '&mpctx->global_sub_pos' as the
pointer; however that variable could be changed during the
mp_property_do() call. Use a pointer to a copy of the original value
instead.

I think this only caused problems if you switched subtitle tracks from
a real one to "disabled" and then switched to a timeline part from
another source.
---
 mplayer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mplayer.c b/mplayer.c
index c09fa7ada9..69e4dcd0fb 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2963,7 +2963,7 @@ static void reinit_decoders(struct MPContext *mpctx)
 {
     reinit_video_chain(mpctx);
     reinit_audio_chain(mpctx);
-    mp_property_do("sub", M_PROPERTY_SET, &mpctx->global_sub_pos, mpctx);
+    mp_property_do("sub", M_PROPERTY_SET, &(int){mpctx->global_sub_pos}, mpctx);
 }
 
 static void seek_reset(struct MPContext *mpctx)