Opened 12 days ago

Closed 38 hours ago

#10981 closed defect (invalid)

avformat_open_input cant handle unicode filename after update to ffmpeg-6 and c++20

Reported by: DarylE Owned by:
Priority: normal Component: avformat
Version: 6.1.1 Keywords: unicode
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Our c++ application (xlights.org) is now failing with unable to open mp3 files when given a filename with unicode characters.
eg. Everybody Want (From “The Hunger Games_ Catching Fire” Soundtrack).mp3

this is our call.

int res = avformat_open_input(&formatContext, _audio_file.c_str(), nullptr, nullptr)

Is there anything we could or should have done to handle this now in this version of avformat?
(windows 64bit, along with Unix and MacOS)

Change History (4)

comment:1 by DarylE, 12 days ago

Summary: avformat_open_input cant handle unicode filename after update to ffmpeg-6avformat_open_input cant handle unicode filename after update to ffmpeg-6 and c++20

comment:2 by Marton Balint, 4 days ago

Are you passing the filename as UTF-8?

comment:3 by DarylE, 3 days ago

This is the definition ..

std::string _audio_file;

Our fix was to go thru the code with ToUTF8(). Weird how this would have changed..

int res = avformat_open_input(&formatContext, ToUTF8(_audio_file).c_str(), nullptr, nullptr);

comment:4 by Marton Balint, 38 hours ago

Resolution: invalid
Status: newclosed

Maybe this changed the behaviour: 92885f26817b6b2515ac9fd5410c9e8be64bd0c0

In any case, you should pass UTF8 filenames to avformat_open_input, so closing this.

Note: See TracTickets for help on using tickets.