Example #1
0
void pmp_read_close(struct pmp_read_struct *p)
	{
    pmp_file_close(&p->file);

    if (!(p->f < 0))           sceIoClose(p->f);
    if (p->buffer_0      != 0) free_64(p->buffer_0);
    if (p->buffer_1      != 0) free_64(p->buffer_1);
    if (p->packet_header != 0) free_64(p->packet_header);


	pmp_read_safe_constructor(p);
	}
void buffered_reader_close(buffered_reader_t * reader)
{
	if (reader) {
		if (!(reader->handle < 0))
			sceIoClose(reader->handle);
		if (reader->buffer_0 != 0)
			free_64(reader->buffer_0);
		if (reader->buffer_1 != 0)
			free_64(reader->buffer_1);
		if (reader->buffer_2 != 0)
			free_64(reader->buffer_2);
		free(reader);
	}
}
Example #3
0
void mp4_file_close(struct mp4_file_struct *p) {
	if (p->info != 0) {
		mp4info_close(p->info);
	}
	
	int i;
	for(i=0; i < 4; i++) {
		if ( p->subtitle_track_time[i] )
			free_64(p->subtitle_track_time[i]);
	}
	
	if ( p->avc_sps )
		free_64(p->avc_sps);
	if ( p->avc_pps )
		free_64(p->avc_pps);
	if ( p->samples )
		free_64(p->samples);
	if ( p->indexes )
		free_64(p->indexes);
	mp4_file_safe_constructor(p);
}
Example #4
0
void mp4_read_close(struct mp4_read_struct *p) {
	
	mp4_file_close(&p->file);

	if (!(p->video_handle < 0))
		sceIoClose(p->video_handle);
	if (!(p->audio_handle < 0))
		sceIoClose(p->audio_handle);
	
	if (p->video_buffer_0 != 0)
		free_64(p->video_buffer_0);
	if (p->video_buffer_1 != 0)
		free_64(p->video_buffer_1);
	if (p->audio_buffer_0 != 0)
		free_64(p->audio_buffer_0);
	if (p->audio_buffer_1 != 0)
		free_64(p->audio_buffer_1);
	
	if (p->audio_cache_buffer != 0)
		free_64(p->audio_cache_buffer);
	
	mp4_read_safe_constructor(p);
}
struct subtitle_frame_struct* subtitle_parse_microdvd( FILE *f, char* charset, unsigned int rate, unsigned int scale )
	{
	if (!f) return(0);
	
	struct subtitle_frame_struct *p = (struct subtitle_frame_struct*)malloc_64( sizeof(struct subtitle_frame_struct) );
	if (p==0) return(0);
	subtitle_frame_safe_constructor(p);
	
	int result = fscanf( f, "{%i}{%i}", &p->p_start_frame, &p->p_end_frame );
	if (result==EOF)
		{
		free_64(p);
		return(0);
		}
	
	char c;
	int i = 0;
	p->p_num_lines = 1;
	while (i<max_subtitle_string-1)
		{
		c = fgetc(f);
		if (c=='\n' || c==EOF) break;
		if (c=='|')
			{
			p->p_string[i++]='\n';
			p->p_num_lines++;
			}
		else
			{
			p->p_string[i++]=c;
			}
		}
	p->p_string[i] = '\0';
	
	if ( miniConvHaveSubtitleConv(charset) ) {
		char* temp_str = miniConvSubtitleConv(p->p_string, charset);
		if( temp_str != NULL ) {
			strncpy(p->p_string, temp_str, max_subtitle_string-1);
		}
	}
	else if ( stricmp(charset, "DEFAULT") == 0 && miniConvHaveDefaultSubtitleConv() ){
		char* temp_str = miniConvDefaultSubtitleConv(p->p_string);
		if( temp_str != NULL ) {
			strncpy(p->p_string, temp_str, max_subtitle_string-1);
		}
	}
	
	return(p);
	}