Mercurial > mplayer.hg
comparison libvo/vo_pnm.c @ 30516:f4e017b6921a
Fix exit_player() usage throughout the codebase.
exit_player() was declared with differing parameter types in mplayer.c and
mplayer.h. Make the declaration in the .h file match the one in the .c file
and adjust all usages of exit_player() throughout the codebase. Also move
the exit_player() declaration into mp_core.h next to exit_player_with_rc().
author | diego |
---|---|
date | Sun, 14 Feb 2010 10:53:20 +0000 |
parents | 1772a5171ac7 |
children | 32725ca88fed |
comparison
equal
deleted
inserted
replaced
30515:9c07a0af62d8 | 30516:f4e017b6921a |
---|---|
37 #include "config.h" | 37 #include "config.h" |
38 #include "subopt-helper.h" | 38 #include "subopt-helper.h" |
39 #include "mp_msg.h" | 39 #include "mp_msg.h" |
40 #include "video_out.h" | 40 #include "video_out.h" |
41 #include "video_out_internal.h" | 41 #include "video_out_internal.h" |
42 #include "mplayer.h" /* for exit_player() */ | 42 #include "mp_core.h" /* for exit_player() */ |
43 #include "help_mp.h" | 43 #include "help_mp.h" |
44 | 44 |
45 /* ------------------------------------------------------------------------- */ | 45 /* ------------------------------------------------------------------------- */ |
46 | 46 |
47 /* Defines */ | 47 /* Defines */ |
96 * \return nothing It does not return. | 96 * \return nothing It does not return. |
97 */ | 97 */ |
98 | 98 |
99 static void pnm_write_error(void) { | 99 static void pnm_write_error(void) { |
100 mp_msg(MSGT_VO, MSGL_ERR, MSGTR_ErrorWritingFile, info.short_name); | 100 mp_msg(MSGT_VO, MSGL_ERR, MSGTR_ErrorWritingFile, info.short_name); |
101 exit_player(MSGTR_Exit_error); | 101 exit_player(EXIT_ERROR); |
102 } | 102 } |
103 | 103 |
104 /* ------------------------------------------------------------------------- */ | 104 /* ------------------------------------------------------------------------- */ |
105 | 105 |
106 /** \brief Pre-initialisation. | 106 /** \brief Pre-initialisation. |
212 if ( stat(buf, &stat_p ) < 0 ) { | 212 if ( stat(buf, &stat_p ) < 0 ) { |
213 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", info.short_name, | 213 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", info.short_name, |
214 MSGTR_VO_GenericError, strerror(errno) ); | 214 MSGTR_VO_GenericError, strerror(errno) ); |
215 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s %s\n", info.short_name, | 215 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s %s\n", info.short_name, |
216 MSGTR_VO_UnableToAccess,buf); | 216 MSGTR_VO_UnableToAccess,buf); |
217 exit_player(MSGTR_Exit_error); | 217 exit_player(EXIT_ERROR); |
218 } | 218 } |
219 if ( !S_ISDIR(stat_p.st_mode) ) { | 219 if ( !S_ISDIR(stat_p.st_mode) ) { |
220 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s %s\n", info.short_name, | 220 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s %s\n", info.short_name, |
221 buf, MSGTR_VO_ExistsButNoDirectory); | 221 buf, MSGTR_VO_ExistsButNoDirectory); |
222 exit_player(MSGTR_Exit_error); | 222 exit_player(EXIT_ERROR); |
223 } | 223 } |
224 if ( !(stat_p.st_mode & S_IWUSR) ) { | 224 if ( !(stat_p.st_mode & S_IWUSR) ) { |
225 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", info.short_name, | 225 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", info.short_name, |
226 buf, MSGTR_VO_DirExistsButNotWritable); | 226 buf, MSGTR_VO_DirExistsButNotWritable); |
227 exit_player(MSGTR_Exit_error); | 227 exit_player(EXIT_ERROR); |
228 } | 228 } |
229 | 229 |
230 if (strcmp(buf, ".") != 0) { | 230 if (strcmp(buf, ".") != 0) { |
231 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s - %s\n", info.short_name, | 231 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s - %s\n", info.short_name, |
232 buf, MSGTR_VO_DirExistsAndIsWritable); | 232 buf, MSGTR_VO_DirExistsAndIsWritable); |
236 default: | 236 default: |
237 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", info.short_name, | 237 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", info.short_name, |
238 MSGTR_VO_GenericError, strerror(errno) ); | 238 MSGTR_VO_GenericError, strerror(errno) ); |
239 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", info.short_name, | 239 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", info.short_name, |
240 buf, MSGTR_VO_CantCreateDirectory); | 240 buf, MSGTR_VO_CantCreateDirectory); |
241 exit_player(MSGTR_Exit_error); | 241 exit_player(EXIT_ERROR); |
242 } /* end switch */ | 242 } /* end switch */ |
243 } else if ( verbose ) { | 243 } else if ( verbose ) { |
244 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s - %s\n", info.short_name, | 244 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s - %s\n", info.short_name, |
245 buf, MSGTR_VO_DirectoryCreateSuccess); | 245 buf, MSGTR_VO_DirectoryCreateSuccess); |
246 } /* end if */ | 246 } /* end if */ |
440 static char subdirname[BUFLENGTH] = ""; | 440 static char subdirname[BUFLENGTH] = ""; |
441 FILE *outfile; | 441 FILE *outfile; |
442 | 442 |
443 if (!mpi) { | 443 if (!mpi) { |
444 mp_msg(MSGT_VO, MSGL_ERR, "%s: No image data suplied to video output driver\n", info.short_name ); | 444 mp_msg(MSGT_VO, MSGL_ERR, "%s: No image data suplied to video output driver\n", info.short_name ); |
445 exit_player(MSGTR_Exit_error); | 445 exit_player(EXIT_ERROR); |
446 } | 446 } |
447 | 447 |
448 /* Start writing to new subdirectory after a certain amount of frames */ | 448 /* Start writing to new subdirectory after a certain amount of frames */ |
449 if ( framecounter == pnm_maxfiles ) { | 449 if ( framecounter == pnm_maxfiles ) { |
450 framecounter = 0; | 450 framecounter = 0; |
472 mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name, | 472 mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name, |
473 MSGTR_VO_CantCreateFile); | 473 MSGTR_VO_CantCreateFile); |
474 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", | 474 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", |
475 info.short_name, MSGTR_VO_GenericError, | 475 info.short_name, MSGTR_VO_GenericError, |
476 strerror(errno) ); | 476 strerror(errno) ); |
477 exit_player(MSGTR_Exit_error); | 477 exit_player(EXIT_ERROR); |
478 } | 478 } |
479 | 479 |
480 pnm_write_pnm(outfile, mpi); | 480 pnm_write_pnm(outfile, mpi); |
481 | 481 |
482 fclose(outfile); | 482 fclose(outfile); |