⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pmp_microdvd.c

📁 pmpmodavc102_sub_src,psp下很好的播放器源码
💻 C
字号:
/*
PMP Mod
Copyright (C) 2006 Raphael

E-mail:   raphael@fx-world.org

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/*
microdvd subtitle format parser
*/


#include "pmp_microdvd.h"
#include "mem64.h"


struct pmp_sub_frame_struct* pmp_sub_parse_microdvd( FILE *f )
	{
	if (!f) return(0);
	
	struct pmp_sub_frame_struct *p = (struct pmp_sub_frame_struct*)malloc_64( sizeof(struct pmp_sub_frame_struct) );
	if (p==0) return(0);
	p->p_string[0] = '\0';
	
	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';
	
	return(p);
	}
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -