aboutsummaryrefslogtreecommitdiff
path: root/libraries/libdvdcss/patches/0005-Don-t-close-any-handle-if-callback-functions-are-use.patch
blob: ab67c0e0babc912547eb60270f8cba54e1b39627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 5bec036cfee3950d002f3c46c17bbd4e375d5bd6 Mon Sep 17 00:00:00 2001
From: Hannes Domani <ssbssa@yahoo.de>
Date: Thu, 25 Feb 2016 21:03:29 +0100
Subject: [PATCH 5/5] Don't close any handle if callback functions are used

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
 src/device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/device.c b/src/device.c
index af735e0..baa4bc5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -406,6 +406,11 @@ int dvdcss_open_device ( dvdcss_t dvdcss )
 
 int dvdcss_close_device ( dvdcss_t dvdcss )
 {
+    if( dvdcss->p_stream )
+    {
+        return 0;
+    }
+
 #if defined( _WIN32 )
     /* Free readv temporary buffer */
     free( dvdcss->p_readv_buffer );
-- 
2.10.0