Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 60542 | Differences between
and this patch

Collapse All | Expand All

(-)libspeex.c.old (-15 / +22 lines)
Lines 190-196 Link Here
190
190
191
static void play (char *filename) {
191
static void play (char *filename) {
192
192
193
	speex_comment_t comments;
193
	speex_comment_t comments = {0};
194
194
195
	if (speex_fs == NULL)
195
	if (speex_fs == NULL)
196
		speex_fs = malloc(sizeof(Speex_File_State));
196
		speex_fs = malloc(sizeof(Speex_File_State));
Lines 215-223 Link Here
215
	}
215
	}
216
	else
216
	else
217
	{
217
	{
218
		speex_file_info(filename, NULL, &comments, &speex_fs->length);
218
		if (!speex_file_info(filename, NULL, &comments, &speex_fs->length))
219
		speex_fs->length *= 1000;
219
		{
220
		speex_fs->title = generate_title(filename, &comments);
220
			speex_fs->length *= 1000;
221
			speex_fs->title = generate_title(filename, &comments);
222
		}
223
		speex_comment_free(&comments);
221
	}
224
	}
222
225
223
226
Lines 235-240 Link Here
235
			fprintf(stderr, PACKAGE ": error opening file\n");
238
			fprintf(stderr, PACKAGE ": error opening file\n");
236
			#endif
239
			#endif
237
			
240
			
241
			speex_fs->playing = FALSE;
238
			return;
242
			return;
239
		}
243
		}
240
	}
244
	}
Lines 265-271 Link Here
265
	SpeexBits sbits;
269
	SpeexBits sbits;
266
	SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT;
270
	SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT;
267
271
268
	speex_comment_t comments;
272
	speex_comment_t comments = {0};
269
	int valid_comment;
273
	int valid_comment;
270
	
274
	
271
	#ifdef DEBUG
275
	#ifdef DEBUG
Lines 404-411 Link Here
404
				if (valid_comment)
408
				if (valid_comment)
405
				{
409
				{
406
					speex_fs->title = generate_title(NULL, &comments);
410
					speex_fs->title = generate_title(NULL, &comments);
407
					speex_comment_free(&comments);
408
				}
411
				}
412
				speex_comment_free(&comments);
409
			}
413
			}
410
414
411
		}
415
		}
Lines 672-682 Link Here
672
}
676
}
673
677
674
static void stop (void) {
678
static void stop (void) {
675
	speex_fs->playing = FALSE;
679
	if (speex_fs->playing == TRUE)
680
	{
681
		speex_fs->playing = FALSE;
676
682
677
	// Wait for the thread to close
683
		// Wait for the thread to close
678
	pthread_join(spx_decode_thread, NULL);
684
		pthread_join(spx_decode_thread, NULL);
679
	
685
	}
680
	#ifdef DEBUG
686
	#ifdef DEBUG
681
	fprintf(stderr, PACKAGE ": stop\n");
687
	fprintf(stderr, PACKAGE ": stop\n");
682
	#endif
688
	#endif
Lines 707-713 Link Here
707
713
708
static void get_song_info (char *filename, char **title, int *length) {
714
static void get_song_info (char *filename, char **title, int *length) {
709
715
710
	speex_comment_t comments;
716
	speex_comment_t comments = {0};
711
717
712
#ifdef DEBUG
718
#ifdef DEBUG
713
	fprintf(stderr, "get_song_info\n");
719
	fprintf(stderr, "get_song_info\n");
Lines 720-729 Link Here
720
	}
726
	}
721
	else
727
	else
722
	{
728
	{
723
		speex_file_info(filename, NULL, &comments, length);
729
		if(!speex_file_info(filename, NULL, &comments, length))
724
		*length *= 1000;
730
		{
725
		(*title) = g_strdup(generate_title(filename, &comments));
731
			*length *= 1000;
726
732
			(*title) = generate_title(filename, &comments);
733
		}
727
		speex_comment_free(&comments);
734
		speex_comment_free(&comments);
728
	}
735
	}
729
736
(-)speexutil.c.old (-11 / +10 lines)
Lines 161-175 Link Here
161
				}
161
				}
162
				else if (op.packetno == 1)
162
				else if (op.packetno == 1)
163
				{
163
				{
164
					if (comment != NULL)
164
					if (comment != NULL && comment->vendor == NULL)
165
					{
165
					{
166
						if (!speex_comment_init(op.packet, op.bytes, comment))
166
						if (!speex_comment_init(op.packet, op.bytes, comment))
167
						{
167
						{
168
							#ifdef DEBUG
168
							#ifdef DEBUG
169
							fprintf(stderr,"Warning: invalid comment struct\n");
169
							fprintf(stderr,"Warning: invalid comment struct\n");
170
							#endif
170
							#endif
171
							
172
							memset(comment, 0, sizeof(speex_comment_t));
173
						}
171
						}
174
					}
172
					}
175
					
173
					
Lines 310-326 Link Here
310
	int i;
308
	int i;
311
309
312
	// Free vendor-string
310
	// Free vendor-string
313
	free(comment->vendor);
311
	if(comment->vendor != NULL) free(comment->vendor);
314
312
315
	// Free comments
313
	if(comment->comments != NULL) 
316
	for(i=0; i < comment->comment_num; i++)
317
	{
314
	{
318
		free( *(comment->comments+i));
315
		// Free comments
316
		for(i=0; i < comment->comment_num; i++)
317
		{
318
			free( *(comment->comments+i));
319
		}
320
		// Free comment index
321
		free(comment->comments);
319
	}
322
	}
320
321
	// Free comment index
322
	free(comment->comments);
323
324
	return;
323
	return;
325
}
324
}
326
	
325
	

Return to bug 60542