player: remove confusing argc/argv adjustment

It's better if argc/argv always mean the same thing.
travis-ci: update Libav release

Libav 10 was released, so we can enable testing the stable Libav version
again.

FFmpeg 2.2 was also released, but since we still support 2.1.4, we stick
with the older version. This is better for testing.
stream_bluray: fix for significant memory leak

It's obvious but, since STREAM_CTRL_GET_TIME_LENGTH is called
frequently, the amount of leaked memory here is quite big.
vo_opengl: runtime icc profile switching

The changes in vo_opengl.c are merely for adding the icc options to the
set of options than can be changed with the vo_cmdline command.
stream_cdda: report track times

Report the time for each chapter (tracks are treated as chapters). This
allows us to get rid of the "old" chapter mechanism, and also behaves
better with the frontend.

This makes assumptions about the audio formats, but that format is
hardcoded anyway in the rawaudio demuxer defaults (and always was).
stream: remove old chapter handling code

Stream-level chapters (like DVD etc.) did potentially not have
timestamps for each chapter, so STREAM_CTRL_SEEK_TO_CHAPTER and
STREAM_CTRL_GET_CURRENT_CHAPTER were needed to navigate chapters. We've
switched everything to use timestamps and that seems to work, so we can
simplify the code and remove this old mechanism.
player: remove demuxer chapoter API wrappers

Instead, always use the mpctx->chapters array. Before this commit, this
array was used only for ordered chapters and such, but now it's always
populated if there are chapters.
player: remove weird separation between no chapters and 0 chapters

For some reason, it mattered whether mpctx->chapters was NULL or not,
even if mpctx->num_chapters was 0. Remove this separation; it serves no
purpose.
player: let chapter_start_time() return MP_NOPTS_VALUE for unknown times
player: handle chapter range like --start/--end

Instead of comparing the current chapter every time, set the playback
end timestamp to the chapter end. Likewise, don't execute an extra seek
for the start chapter.

Maybe we could also use the timeline facility to restrict playback to
the given chapter range, but this would be strange when using
--chapter=N to start playback at a given chapter. Then you couldn't seek
back, which is possibly not what the user wants.
player: use MP_NOPTS_VALUE as rel_time_to_abs() error value

And consistently use MP_NOPTS_VALUE as error value for the users of this
function. This is better than using -1, especially because negative
values can be valid timestamps.
dvdnav: prevent reallocation of fake highlight buffer

Since subsizes were never updated, the bitmap buffer was always
reallocated whenever mp_nav_get_highlight() called.
dvdnav: make MP_NAV_EVENT_RESET_ALL handled properly

dvdnav.c did not handle event in regular sequence. Usually this
does not make any trouble except around MP_NAV_EVENT_RESET_ALL.
Those events should be handled in regular sequence. If they're
mixed, it can make wrong result.
For instance, MP_NAV_EVENT_HIGHLIGHT right after
MP_NAV_EVENT_RESET_ALL should not be ignored but it might be
because MP_NAV_EVENT_RESET_ALL makes the demuxer reloaded and osd
hidden.
dvdnav: check and update video resolution whenever rendering

Previous implementation updated video resolution when highlight
event was given. However, this may not work if highlight event
is given before video size is queried.
This commit adds checking routine into rendering function, too.
dvdnav: fix minor memory leak

This was usually handled at the end of the switch statement, so if
something returns from the function before that, the event has to be
freed explicitly.
cocoa: fix native fullscreen

This fixes a couple of issues with the Cocoa `--native-fs` mode, primarily:

 - A ghost titlebar at the top of the screen in full screen:

   This was caused by the window constraining code kicking in during
   fullscreen. Simply returning the unconstrained rect from the constraining
   method fixes the problem.

 - Incorrect behavior when using the titlebar buttons to enter/exit
   fullscreen, as opposed to the OSD button.

   This was caused by mpv's internal fullscreen state going out of sync with
   the NSWindow's one. This was the case because `toggleFullScreen:`
   completely bypassed the normal event flow that mpv expects.

Signed-off-by: Ryan Goulden <percontation@gmail.com>

Change style for mpv, simplify and refactor some of the constraining code.

Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
cocoa: cosmetics: use NSMakeSize
cocoa: move sync section assignments in vo_control
cocoa: Use default NSWindow constraining

With recent work in place, it now has good behavior and custom constraining is unnecessary.