diff options
author | Marco Nelissen <marcone@google.com> | 2013-11-01 10:33:18 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2013-11-01 10:33:18 -0700 |
commit | 3e518fd5d679abb83b654e473ea0fa5f7f16235f (patch) | |
tree | 96ca7ab7e49d6f1535bc459bf89d8a1040e5a219 /media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp | |
parent | 9cae217050aa1347d4ac5053c305754879e3f97f (diff) | |
download | frameworks_av-3e518fd5d679abb83b654e473ea0fa5f7f16235f.zip frameworks_av-3e518fd5d679abb83b654e473ea0fa5f7f16235f.tar.gz frameworks_av-3e518fd5d679abb83b654e473ea0fa5f7f16235f.tar.bz2 |
Notify current video size if available
b/11248101
Change-Id: I0fa3b5592efcf400c86692002267da6825e331ad
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp index d8b35d7..f1782cc 100644 --- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp +++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp @@ -201,7 +201,16 @@ void NuPlayer::HTTPLiveSource::onSessionNotify(const sp<AMessage> &msg) { switch (what) { case LiveSession::kWhatPrepared: { - notifyVideoSizeChanged(0, 0); + // notify the current size here if we have it, otherwise report an initial size of (0,0) + sp<AMessage> format = getFormat(false /* audio */); + int32_t width; + int32_t height; + if (format != NULL && + format->findInt32("width", &width) && format->findInt32("height", &height)) { + notifyVideoSizeChanged(width, height); + } else { + notifyVideoSizeChanged(0, 0); + } uint32_t flags = FLAG_CAN_PAUSE; if (mLiveSession->isSeekable()) { |