Skip to content

Commit 1aa095e

Browse files
committed
Set global header using C++ API instead of C
1 parent 82bc3e3 commit 1aa095e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example/api2-samples/api2-hw-encode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ int main(int argc, char **argv) {
155155

156156
// MKV format wants global header, so
157157
// this fixes the issue with MKV container
158-
if (ofrmt.raw()->flags & AVFMT_GLOBALHEADER)
159-
encoder.raw()->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
158+
if (ofrmt.flags() & AVFMT_GLOBALHEADER)
159+
encoder.addFlags(AV_CODEC_FLAG_GLOBAL_HEADER);
160160

161161
encoder.open(Codec(), ec);
162162
if (ec) {

0 commit comments

Comments
 (0)