Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Issue 544843005: Avoid FFmpeg destroying active resources during demuxer stop. (Closed)

Created:
6 years, 3 months ago by DaleCurtis
Modified:
6 years, 3 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org
Base URL:
http://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Avoid FFmpeg destroying active resources during demuxer stop. The root cause is a combination of BufferedDataSource::Stop() requiring a lock and BlockingURLProtocol::Read() returning control to FFmpeg which may destory resources in use by an ongoing BufferedDataSource::ReadCallback() call. The lock in BDS::Stop() shared by BDS::ReadCallback() prevents the stop signal from taking affect until after the read finishes, however calling BUP::Abort() will immediately returns control to FFmpeg which may destroy the resources in use by BDS::ReadCallback(). Sadly, given the racy nature and multi-class dependencies I've been unable to craft a unit test for this, but I've manually verified this fix works by arbitrarily delaying BDS::Stop() under an ASAN build. BUG=411318 TEST=none Committed: https://crrev.com/1973f0b6f7497b1887397de9bb36dbff4faf5e39 Cr-Commit-Position: refs/heads/master@{#293995}

Patch Set 1 : Typo. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -1 line) Patch
M media/filters/ffmpeg_demuxer.cc View 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 11 (3 generated)
DaleCurtis
Since BufferedDataSource lives in content/ it's not used by any media_unittests. Faking delayed reads with ...
6 years, 3 months ago (2014-09-05 21:12:13 UTC) #3
scherkus (not reviewing)
would writing a test be easier now that acolwell@ moved our code to media/blink/?
6 years, 3 months ago (2014-09-09 17:29:28 UTC) #4
DaleCurtis
Ah, I didn't realize he was moving BufferedDataSource too. Let me think about it.
6 years, 3 months ago (2014-09-09 17:30:16 UTC) #5
DaleCurtis
Not really, the media/blink code is part of a new media_blink target, so we can't ...
6 years, 3 months ago (2014-09-09 17:50:22 UTC) #6
scherkus (not reviewing)
lgtm
6 years, 3 months ago (2014-09-09 18:03:41 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/544843005/20001
6 years, 3 months ago (2014-09-09 18:11:16 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:20001) as a8cffdefe2f7888d0dc01e8c7cf5ef312adf5611
6 years, 3 months ago (2014-09-09 20:04:45 UTC) #10
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:55:10 UTC) #11
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/1973f0b6f7497b1887397de9bb36dbff4faf5e39
Cr-Commit-Position: refs/heads/master@{#293995}

Powered by Google App Engine
This is Rietveld 408576698