comparison libvo/vo_jpeg.c @ 13252:7dfd84faaa09

Some minor vo_jpeg fixes: Removed unused variable dst. MPlayer now exits if it is unable to create a file for JPEG output and prints an appropriate message, instead of going on if all is right (which is not). Added line to authors file.
author ivo
date Sun, 05 Sep 2004 17:54:09 +0000
parents 933b45ad31d5
children 858b7e04718c
comparison
equal deleted inserted replaced
13251:99b14d9c50d5 13252:7dfd84faaa09
8 * 8 *
9 * Original version: Copyright 2002 by Pontscho (pontscho@makacs.poliod.hu) 9 * Original version: Copyright 2002 by Pontscho (pontscho@makacs.poliod.hu)
10 * 2003-04-25 Spring cleanup -- Alex 10 * 2003-04-25 Spring cleanup -- Alex
11 * 2004-08-04 Added multiple subdirectory support -- Ivo (ivop@euronet.nl) 11 * 2004-08-04 Added multiple subdirectory support -- Ivo (ivop@euronet.nl)
12 * 2004-09-01 Cosmetics update -- Ivo 12 * 2004-09-01 Cosmetics update -- Ivo
13 * 2004-09-05 Added suboptions parser -- Ivo
13 * 14 *
14 */ 15 */
15 16
16 /* ------------------------------------------------------------------------- */ 17 /* ------------------------------------------------------------------------- */
17 18
145 JSAMPROW row_pointer[1]; 146 JSAMPROW row_pointer[1];
146 int row_stride; 147 int row_stride;
147 148
148 if ( !buffer ) return 1; 149 if ( !buffer ) return 1;
149 if ( (outfile = fopen(name, "wb") ) == NULL ) { 150 if ( (outfile = fopen(name, "wb") ) == NULL ) {
150 return 1; 151 mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name,
152 MSGTR_VO_JPEG_CantCreateFile);
153 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n",
154 info.short_name, MSGTR_VO_JPEG_GenericError,
155 strerror(errno) );
156 exit_player(MSGTR_Exit_error);
151 } 157 }
152 158
153 cinfo.err = jpeg_std_error(&jerr); 159 cinfo.err = jpeg_std_error(&jerr);
154 jpeg_create_compress(&cinfo); 160 jpeg_create_compress(&cinfo);
155 jpeg_stdio_dest(&cinfo, outfile); 161 jpeg_stdio_dest(&cinfo, outfile);
187 193
188 static uint32_t draw_frame(uint8_t *src[]) 194 static uint32_t draw_frame(uint8_t *src[])
189 { 195 {
190 static uint32_t framecounter = 0, subdircounter = 0; 196 static uint32_t framecounter = 0, subdircounter = 0;
191 char buf[BUFLENGTH]; 197 char buf[BUFLENGTH];
192 uint8_t *dst = src[0];
193 static char subdirname[BUFLENGTH] = ""; 198 static char subdirname[BUFLENGTH] = "";
194 struct stat stat_p; 199 struct stat stat_p;
195 200
196 /* Start writing to new subdirectory after a certain amount of frames */ 201 /* Start writing to new subdirectory after a certain amount of frames */
197 if ( framecounter == jpeg_maxfiles ) { 202 if ( framecounter == jpeg_maxfiles ) {