diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 02:34:47 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 02:34:47 +0000 |
commit | 5e0b48d38da859082e36895201ca19eb47b3f520 (patch) | |
tree | 9e3c3ed85479d54371aee821d6244f5804b1dd60 /media | |
parent | 3121c76b1641123a8d4cbf21e3a6f7a9efde662a (diff) | |
download | chromium_src-5e0b48d38da859082e36895201ca19eb47b3f520.zip chromium_src-5e0b48d38da859082e36895201ca19eb47b3f520.tar.gz chromium_src-5e0b48d38da859082e36895201ca19eb47b3f520.tar.bz2 |
Update Chromium's FFmpeg file URLProtocol implementation.
The flag values were changed resulting in Chromium opening the file for create resulting in a 0-byte file.
BUG=88784
TEST=use media_bench/ffmpeg_unittests, the file won't be overwritten
Review URL: http://codereview.chromium.org/7466034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/ffmpeg/file_protocol.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/media/ffmpeg/file_protocol.cc b/media/ffmpeg/file_protocol.cc index af2c847..26ba8ce 100644 --- a/media/ffmpeg/file_protocol.cc +++ b/media/ffmpeg/file_protocol.cc @@ -28,17 +28,21 @@ static int GetHandle(URLContext *h) { // FFmpeg protocol interface. static int OpenContext(URLContext* h, const char* filename, int flags) { int access = O_RDONLY; - if (flags & URL_RDWR) { + + if ((flags & AVIO_FLAG_WRITE) && (flags & AVIO_FLAG_READ)) { access = O_CREAT | O_TRUNC | O_RDWR; - } else if (flags & URL_WRONLY) { + } else if (flags & AVIO_FLAG_WRITE) { access = O_CREAT | O_TRUNC | O_WRONLY; } + #ifdef O_BINARY access |= O_BINARY; #endif + int f = open(filename, access, 0666); if (f == -1) return AVERROR(ENOENT); + h->priv_data = reinterpret_cast<void*>(static_cast<intptr_t>(f)); h->is_streamed = false; return 0; |