Skip to content

Commit

Permalink
api2-remux: replace CodecParameters access with Getters&Setters
Browse files Browse the repository at this point in the history
  • Loading branch information
h4tr3d committed Mar 9, 2024
1 parent f5b9ac9 commit 2d46371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example/api2-samples/api2-remux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int main(int argc, char **argv)
for (size_t i = 0, ostIdx = 0; i < ictx.streamsCount(); ++i) {
auto ist = ictx.stream(i);
auto icodecpar = ist.codecParameters();
auto ocodec = av::findEncodingCodec(icodecpar.raw()->codec_id);
auto ocodec = icodecpar.decodingCodec();

// Source codec can be unsupprted by the target format. Transcoding required or simple skip.
if (!octx.outputFormat().codecSupported(ocodec)) {
Expand All @@ -125,7 +125,7 @@ int main(int argc, char **argv)

auto ost = octx.addStream(ec);
ost.setCodecParameters(icodecpar);
ost.codecParameters().raw()->codec_tag = 0;
ost.codecParameters().codecTag(0);

// We can omit codec checking above and got error FormatCodecUnsupported (error code or exception)
if (ec) {
Expand Down

0 comments on commit 2d46371

Please sign in to comment.