mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
884653ee5b
When muxing, the AVStreams' side-data is typically set by the caller before avformat_write_header(); it is not documented to be else. Yet the Matroska muxer added an AVStereo3D side data if certain metadata was present: Since commit 4d686fb721b485ebbc4c7779d927d876c1e630f7 (adding support for AVStereo3D stream side-data), the Matroska muxer checked certain stream tags that contain Matroska's StereoMode and (if they are present) converted this value into an AVStereo3D struct that gets attached to the AVStream (reusing a function from the demuxer). Afterwards the AVStereo3D side data struct (whether it has just been added by the muxer or not) gets parsed and converted back into a Matroska StereoMode. Besides being an API violation this change broke StereoMode values without a corresponding AVStereo3D (namely the anaglyph ones). This commit fixes this: A StereoMode given via tags is now used-as-is; if no such tag exists and an AVStereo3D side data exists, it is converted into the corresponding StereoMode (if possible). This approach also fixes handling of the anaglyph ones; the changes to the matroska-stereo_mode are due to this. The new STEREOMODE_STEREO3D_MAPPING has been put to good use for this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>