[MPlayer-dev-eng] Return correct stream IDs for slave mode

Hermi Mercury hermi.hg at gmail.com
Wed Apr 6 20:44:47 CEST 2011


get_property switch_audio/video is returning demuxer streamIDs which are not
useful for switching tracks.  This patch changes two functions to return the
proper audio/video ids.

This is based on a patch that Reimar Döffinger
posted<http://web.archiveorange.com/archive/v/rmoqPJz2oij9wmyPZ4yk>over
a year ago, but which was never implemented, possibly due to a typo in
his version.  This patch fixes that typo, and applies the fix to the
set_property commands as well.

I have tested this fix with a variety of container formats:
             get audio    get video    set audio    set video
MKV        works         works        works          works*
M4V         works         works        works        untested
OGM        works         works        works        untested
AVI          works         works        works        untested
DVD        untested    untested    untested    untested

*The new video track exhibits momentary graphical corruption after the
switch and after every subsequent seek with h264 video.  Switching back to
the original track removes the corruption.  This is another bug for another
patch though.

*Aside:  **There is also a secondary problem with the corevideo video output
for Mac OS X that causes a double uninit (which is not safe and causes
frontends to crash) when switching video streams, but I have not yet found a
satisfactory solution.  Removing the free_file_specific call from
configure() in vo_corevideo.m fixes video track switching, but breaks
restarting the video.  Multi-video-stream files are so rare that there are
likely many bugs in video switching.*

I hope this patch is up to the project's quality standards.  I have been
poking through the source code of the mplayer2.org fork, which is so much
cleaner than mplayer's that I feel like every line I add is a kludge
compared to the complete rewrites he has done.

- Hermi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_stream_ids.diff
Type: application/octet-stream
Size: 4474 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110406/1d4a2aa1/attachment.obj>


More information about the MPlayer-dev-eng mailing list