Opened 11 hours ago

Last modified 11 hours ago

#11420 new defect

macos clang -O3 produce buggy ffmpeg: output is rotated 90 degree.

Reported by: ffmpeg-fixes Owned by:
Priority: important Component: ffmpeg
Version: unspecified Keywords: clang rotated
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by ffmpeg-fixes)

Summary of the bug:

compile with clang, CFLAGS=" -O3" ./configure, ffmpeg output is rotated 90 degree by default, tested on ffmpeg 6.1.2, 7.1 and latest git, all the same. work around is rolling back to ffmpeg 5.1.5, or drop the '-O3' flag.

could be some 'volatile' keyword missing, to prevent the compiler from optimizing away some variables.

How to reproduce:

CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
LDFLAGS=" -O3 ....._some_other_flags" \
CFLAGS=" -O3 ....._some_other_flags" \
CXXFLAGS="-O3 ....._some_other_flags" \
CPPFLAGS="-O3 ....._some_other_flags" \
./configure

make -j8

% ffmpeg -i in.mp4 out.mp4 -y

input:  1920x1080 [SAR 1:1 DAR 16:9]
output: 1080x1920 [SAR 1:1 DAR 9:16]

ffmpeg 6.1.2, 7.1 and latest git

built on Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0

Change History (1)

comment:1 by ffmpeg-fixes, 11 hours ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.