annotate libdvdcss/error.c @ 36325:e6174864737a

Fix a possible crash when DRI failed.
author reimar
date Mon, 12 Aug 2013 19:56:34 +0000
parents 691431d2289e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
1 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
2 * error.c: error management functions
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
3 *****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
4 * Copyright (C) 1998-2002 VideoLAN
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
5 *
27462
60bd1a7f3fc6 Sync libdvdcss with upstream version 1.2.10.
diego
parents: 20613
diff changeset
6 * Author: Sam Hocevar <sam@zoy.org>
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
7 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
8 * This library is free software; you can redistribute it and/or modify
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
11 * (at your option) any later version.
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
12 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
13 * This library is distributed in the hope that it will be useful,
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
16 * GNU General Public License for more details.
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
17 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
18 * You should have received a copy of the GNU General Public License along
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
19 * with this library; if not, write to the Free Software Foundation, Inc.,
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
21 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
22
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
23 #include "config.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
24
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
25 #include <stdio.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
26 #include <stdlib.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
27
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
28 #ifdef HAVE_SYS_PARAM_H
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
29 # include <sys/param.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
30 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
31
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
32 #ifdef HAVE_LIMITS_H
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
33 # include <limits.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
34 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
35
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
36 #include "dvdcss/dvdcss.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
37
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
38 #include "common.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
39 #include "css.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
40 #include "libdvdcss.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
41
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
42 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
43 * Error messages
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
44 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
45 void _print_error( dvdcss_t dvdcss, char *psz_string )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
46 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
47 if( dvdcss->b_errors )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
48 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
49 fprintf( stderr, "libdvdcss error: %s\n", psz_string );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
50 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
51
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
52 dvdcss->psz_error = psz_string;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
53 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
54
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
55 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
56 * Debug messages
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
57 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
58 #if 0
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
59 void _print_debug( dvdcss_t dvdcss, char *psz_string )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
60 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
61 if( dvdcss->b_debug )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
62 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
63 fprintf( stderr, "libdvdcss debug: %s\n", psz_string );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
64 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
65 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
66 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
67