summaryrefslogtreecommitdiff
path: root/gstplayer/GstMetadataRetriever.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gstplayer/GstMetadataRetriever.cpp')
-rw-r--r--gstplayer/GstMetadataRetriever.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/gstplayer/GstMetadataRetriever.cpp b/gstplayer/GstMetadataRetriever.cpp
index 4cc8636..78b6f8f 100644
--- a/gstplayer/GstMetadataRetriever.cpp
+++ b/gstplayer/GstMetadataRetriever.cpp
@@ -86,7 +86,7 @@ status_t GstMetadataRetriever::setDataSource(int fd, int64_t offset, int64_t len
mGstDriver->prepareSync();
status = mGstDriver->getStatus();
- LOGV("GstMetadataRetriever setDataSource %s", (status == GST_STATE_PAUSED)? "OK": "not correct state");
+ LOGV("GstMetadataRetriever setDataSource %s:%d", (status == GST_STATE_PAUSED)? "OK": "not correct state", status);
if(status != GST_STATE_PAUSED)
return UNKNOWN_ERROR;
@@ -108,6 +108,7 @@ status_t GstMetadataRetriever::setMode(int mode)
if (!mLocked) {
LOGV("GstMetadataRetriever setMode activate video protection");
g_static_mutex_lock (&GstMetadataRetriever_mutex);
+ LOGV("Lock on GstMetadataRetriever acquired");
mLocked = 1 ;
} else {
LOGV("GstMetadataRetriever::setMode video protection already activated");
@@ -186,6 +187,7 @@ MediaAlbumArt* GstMetadataRetriever::extractAlbumArt()
mGstDriver->getAlbumArt(&data, &size);
+ LOGV("From extract AlbumArt: Data:%d Size:%d\n", data, size);
if(data && size) {
MediaAlbumArt* albumArt = new MediaAlbumArt();
albumArt->mSize = size;
@@ -194,6 +196,12 @@ MediaAlbumArt* GstMetadataRetriever::extractAlbumArt()
return albumArt; // must free by caller
}
+ if (mLocked) {
+ LOGV("No AlbumArt data, releasing video protection lock");
+ g_static_mutex_unlock(&GstMetadataRetriever_mutex);
+ mLocked = 0;
+ }
+
return NULL;
}