[Android] Fix thumbnailer deadlock (Close #7438)
Rafaël Carré
git at videolan.org
Thu Sep 6 18:04:06 CEST 2012
vlc-ports/android | branch: master | Rafaël Carré <funman at videolan.org> | Thu Sep 6 17:54:38 2012 +0200| [0d2c53774763fff80e0711210a7f9d180e14946a] | committer: Rafaël Carré
Fix thumbnailer deadlock (Close #7438)
Do not call libvlc_media_player_get_{length,position} inside
vout callbacks (set with libvlc_video_set_callbacks)
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0d2c53774763fff80e0711210a7f9d180e14946a
---
vlc-android/jni/thumbnailer.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index a0f5a96..16ccb49 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -80,15 +80,8 @@ static void thumbnailer_unlock(void *opaque, void *picture, void *const *pixels)
if (hasThumb)
return;
- sys->nbReceivedFrames++;
-
- if (libvlc_media_player_get_position(sys->mp) < THUMBNAIL_POSITION / 2
- // Arbitrary choice to work around broken files.
- && libvlc_media_player_get_length(sys->mp) > 1000
- && sys->nbReceivedFrames < 10)
- {
+ if (++sys->nbReceivedFrames < 10)
return;
- }
/* Else we have received our first thumbnail and we can exit. */
const char *dataSrc = sys->frameData;
More information about the Android
mailing list