core: fix attempt to get audio pts without audio
commit65b24e46a1c2f26688458cf16a11733e96da0f22
authorUoti Urpala <uau@mplayer2.org>
Tue, 17 Jul 2012 20:18:06 +0000 (17 23:18 +0300)
committerUoti Urpala <uau@mplayer2.org>
Tue, 17 Jul 2012 20:28:19 +0000 (17 23:28 +0300)
tree7871127d2271eb35751519f1e5b5c3e22815bda0
parent2e8119be9a7474b3f86c53db044cfaa7ec27cbea
core: fix attempt to get audio pts without audio

written_audio_pts() can be called even if no audio track is active (at
least through get_current_time() when there's no known video PTS).
This triggered a crash due to NULL dereference. Add a check to return
MP_NOPTS_VALUE if no audio track exists.

Also remove a questionable update_osd_msg() call from per-file
initialization code. The call was at a point where an audio track
might be selected but not properly initialized, possibly also causing
a crash if update_osd_msg() queries current position. I don't see any
reason why the call would have been needed; it should get called
anyway before OSD contents are actually used for the new file.
mplayer.c