Skip to content

Commit

Permalink
Set AccessMode of MediaIO according to QIODevice it is created from
Browse files Browse the repository at this point in the history
When creating MediaIO from QIODevice in AVMuxer's setMedia one had to
manually call mediaIO() after and set the MediaIO's AccessMode to
writable. This patch checks if the QIODevice is writable and then sets
MediaIO's AccessMode automatically.
  • Loading branch information
0xFelix committed Oct 16, 2017
1 parent f8d9982 commit 16da473
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AVMuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ bool AVMuxer::setMedia(QIODevice* device)
d->format_forced.clear();
}
d->io->setProperty("device", QVariant::fromValue(device)); //open outside?

if (device->isWritable()) {
d->io->setAccessMode(MediaIO::Write);
}

return d->media_changed;
}

Expand Down

0 comments on commit 16da473

Please sign in to comment.