diff options
author | Marco Nelissen <marcone@google.com> | 2013-11-04 17:42:11 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-11-04 17:42:12 +0000 |
commit | f8a1169d98a09d1473f289c363353d08301576f6 (patch) | |
tree | cf676491a9c9a6e5201eba1bd77f2335476629d9 /media | |
parent | 065789f24890b0a9f3614dc175e6f7664af1f2ce (diff) | |
parent | 3e518fd5d679abb83b654e473ea0fa5f7f16235f (diff) | |
download | frameworks_av-f8a1169d98a09d1473f289c363353d08301576f6.zip frameworks_av-f8a1169d98a09d1473f289c363353d08301576f6.tar.gz frameworks_av-f8a1169d98a09d1473f289c363353d08301576f6.tar.bz2 |
Merge "Notify current video size if available" into klp-dev
Diffstat (limited to 'media')
-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()) { |