mirror of
https://github.com/mpv-player/mpv
synced 2025-01-29 19:22:48 +00:00
-playlist option patch by Panagiotis Issaris <takis@lumumba.luc.ac.be>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2648 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0885f41ebf
commit
3c8924371d
@ -2,6 +2,7 @@
|
||||
* config for cfgparser
|
||||
*/
|
||||
|
||||
extern char *playlist_file;
|
||||
|
||||
#ifdef HAVE_FBDEV
|
||||
extern char *fb_dev_name;
|
||||
@ -221,5 +222,6 @@ struct config conf[]={
|
||||
{"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
|
||||
{"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
|
||||
{"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
|
||||
{"playlist", &playlist_file, CONF_TYPE_STRING, 0, 0, 0},
|
||||
{NULL, NULL, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -36,6 +36,7 @@ static char help_text[]=
|
||||
" -fs -vm -zoom fullscreen playing options (fullscr,vidmode chg,softw.scale)\n"
|
||||
" -x <x> -y <y> scale image to <x> * <y> resolution [if -vo driver supports!]\n"
|
||||
" -sub <file> specify subtitle file to use (see also -subfps, -subdelay)\n"
|
||||
" -playlist <file> specify playlist file\n"
|
||||
" -vid x -aid y options to select video (x) and audio (y) stream to play\n"
|
||||
" -fps x -srate y options to change video (x fps) and audio (y Hz) rate\n"
|
||||
" -pp <quality> enable postprocessing filter (0-4 for DivX, 0-63 for mpegs)\n"
|
||||
@ -45,6 +46,7 @@ static char help_text[]=
|
||||
"Keys:\n"
|
||||
" <- or -> seek backward/forward 10 seconds\n"
|
||||
" up or down seek backward/forward 1 minute\n"
|
||||
" < or > seek backward/forward in playlist\n"
|
||||
" p or SPACE pause movie (press any key to continue)\n"
|
||||
" q or ESC stop playing and quit program\n"
|
||||
" + or - adjust audio delay by +/- 0.1 second\n"
|
||||
|
16
help_mp-nl.h
16
help_mp-nl.h
@ -31,7 +31,8 @@ static char help_text[]=
|
||||
" -fs -vm -zoom volledig scherm afspeel opties (fullscr,vidmode chg,softw.scale)\n"
|
||||
" -x <x> -y <y> herschaal beeld naar <x> * <y> resolutie [als -vo driver het ondersteunt!]\n"
|
||||
" -sub <bestand> specificeer het te gebruiken ondertitel bestand (zie ook -subfps, -subdelay)\n"
|
||||
" -vid x -aid y opties om te spelen video (x) en audio stream te selecteren\n"
|
||||
" -playlist <file> specificeer het te gebruiken playlist bestand\n"
|
||||
" -vid x -aid y opties om te spelen video (x) en audio (y) stream te selecteren\n"
|
||||
" -fps x -srate y opties om video (x fps) en audio (y Hz) tempo te veranderen\n"
|
||||
" -pp <kwaliteit> activeer postprocessing filter (0-4 voor DivX, 0-63 voor mpegs)\n"
|
||||
" -nobps gebruik alternatieve A-V sync methode voor AVI bestand (kan helpen!)\n"
|
||||
@ -41,6 +42,7 @@ static char help_text[]=
|
||||
" <- of -> ga 10 seconden achterwaards/voorwaards\n"
|
||||
" omhoog of omlaag ga 1 minuut achterwaards/voorwaards\n"
|
||||
" PGUP of PGDOWN ga 10 minuten achterwaards/voorwaards\n"
|
||||
" < or > ga naar vorige/volgende item in playlist\n"
|
||||
" p of SPACE pauzeer film (druk eender welke toets om verder te gaan)\n"
|
||||
" q of ESC stop afspelen en sluit programma af\n"
|
||||
" + of - pas audio vertraging aan met +/- 0.1 second\n"
|
||||
@ -56,7 +58,7 @@ static char help_text[]=
|
||||
|
||||
// mplayer.c:
|
||||
|
||||
#define MSGTR_Exiting "\nExiting... (%s)\n"
|
||||
#define MSGTR_Exiting "\nBezig met afsluiten... (%s)\n"
|
||||
#define MSGTR_Exit_frames "Gevraagde aantal frames afgespeeld"
|
||||
#define MSGTR_Exit_quit "Stop"
|
||||
#define MSGTR_Exit_eof "Einde van bestand"
|
||||
@ -124,8 +126,8 @@ static char help_text[]=
|
||||
#define MSGTR_DVDopenOk "DVD openen geslaagd!\n"
|
||||
|
||||
// demuxer.c, demux_*.c:
|
||||
#define MSGTR_AudioStreamRedefined "Waarschuwing! Audio stream header %d hergedefinieerd!\n"
|
||||
#define MSGTR_VideoStreamRedefined "Waarschuwing! Video stream header %d hergedefinieerd!\n"
|
||||
#define MSGTR_AudioStreamRedefined "Waarschuwing! Audio stream header %d geherdefinieerd!\n"
|
||||
#define MSGTR_VideoStreamRedefined "Waarschuwing! Video stream header %d geherdefinieerd!\n"
|
||||
#define MSGTR_TooManyAudioInBuffer "\nDEMUXER: Te veel (%d in %d bytes) audio packets in de buffer!\n"
|
||||
#define MSGTR_TooManyVideoInBuffer "\nDEMUXER: Te veel (%d in %d bytes) video packets in de buffer!\n"
|
||||
#define MSGTR_MaybeNI "(misschien speel je een non-interleaved stream/bestand of werkte de codec niet)\n"
|
||||
@ -139,10 +141,6 @@ static char help_text[]=
|
||||
#define MSGTR_InvalidMPEGES "Invalid MPEG-ES stream??? Contacteer de auteur, het zou een bug kunnen zijn :(\n"
|
||||
#define MSGTR_FormatNotRecognized "============= Sorry, dit bestandsformaat niet herkend/ondersteund ===============\n"\
|
||||
"=== Als dit een AVI bestand, ASF bestand of MPEG stream is, contacteer dan aub de auteur! ===\n"
|
||||
/*#define MSGTR_MissingASFvideo "ASF: Geen Video stream gevonden!\n"
|
||||
#define MSGTR_MissingASFaudio "ASF: Geen Audio stream gevonden... ->nosound\n"
|
||||
#define MSGTR_MissingMPEGaudio "MPEG: Geen Audio stream gevonden... ->nosound\n"
|
||||
*/
|
||||
#define MSGTR_MissingVideoStream "Geen video stream gevonden!\n"
|
||||
#define MSGTR_MissingAudioStream "Geen audio stream gevonden... ->nosound\n"
|
||||
#define MSGTR_MissingVideoStreamBug "Ontbrekende video stream!? Contacteer de auteur, het zou een bug kunnen zijn :(\n"
|
||||
@ -171,7 +169,7 @@ static char help_text[]=
|
||||
#define MSGTR_CantCloseCodec "kon codec niet sluiten\n"
|
||||
|
||||
#define MSGTR_MissingDLLcodec "FOUT: Kon de nodige DirectShow codec niet openen: %s\n"
|
||||
#define MSGTR_ACMiniterror "Kon jWin32/ACM AUDIO codec niet laden/initialiseren (ontbrekend DLL bestand?)\n"
|
||||
#define MSGTR_ACMiniterror "Kon Win32/ACM AUDIO codec niet laden/initialiseren (ontbrekend DLL bestand?)\n"
|
||||
#define MSGTR_MissingLAVCcodec "Kan codec codec '%s' niet vinden in libavcodec...\n"
|
||||
|
||||
#define MSGTR_NoDShowSupport "MPlayer werd gecompileerd ZONDER directshow ondersteuning!\n"
|
||||
|
44
mplayer.c
44
mplayer.c
@ -209,6 +209,8 @@ static int screen_size_y=0;//SCREEN_SIZE_Y;
|
||||
static int screen_size_xy=0;
|
||||
static float movie_aspect=0.0;
|
||||
|
||||
char* playlist_file;
|
||||
|
||||
// sub:
|
||||
char *font_name=NULL;
|
||||
float font_factor=0.75;
|
||||
@ -423,6 +425,39 @@ int gui_no_filename=0;
|
||||
|
||||
parse_cfgfiles();
|
||||
num_filenames=parse_command_line(conf, argc, argv, envp, &filenames);
|
||||
|
||||
if(playlist_file!=NULL)
|
||||
{
|
||||
FILE *playlist_f;
|
||||
char *playlist_linebuffer = (char*)malloc(256);
|
||||
char *playlist_line;
|
||||
if(!strcmp(playlist_file,"-"))
|
||||
{
|
||||
playlist_f = fopen("/dev/stdin","r");
|
||||
}
|
||||
else
|
||||
playlist_f = fopen(playlist_file,"r");
|
||||
if(playlist_f != NULL)
|
||||
{
|
||||
while(!feof(playlist_f))
|
||||
{
|
||||
memset(playlist_linebuffer,0,255);
|
||||
fgets(playlist_linebuffer,255,playlist_f);
|
||||
if(strlen(playlist_linebuffer)==0)
|
||||
break;
|
||||
playlist_linebuffer[strlen(playlist_linebuffer)-1] = 0;
|
||||
playlist_line = (char*)malloc(strlen(playlist_linebuffer)+1);
|
||||
memset(playlist_line,0,strlen(playlist_linebuffer)+1);
|
||||
strcpy(playlist_line,playlist_linebuffer);
|
||||
if (!(filenames = (char **) realloc(filenames, sizeof(*filenames) * (num_filenames + 2))))
|
||||
exit(3);
|
||||
filenames[num_filenames++] = playlist_line;
|
||||
}
|
||||
fclose(playlist_f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(num_filenames<0) exit(1); // error parsing cmdline
|
||||
|
||||
#ifndef HAVE_NEW_GUI
|
||||
@ -1513,9 +1548,18 @@ if(step_sec>0) {
|
||||
// quit
|
||||
case KEY_ESC: // ESC
|
||||
case 'q': exit_player(MSGTR_Exit_quit);
|
||||
case '>':
|
||||
if(curr_filename>=num_filenames-1)
|
||||
break;
|
||||
case KEY_ENTER: // ESC
|
||||
eof=1; // jump to next file
|
||||
break;
|
||||
case '<':
|
||||
if(curr_filename < 1)
|
||||
break;
|
||||
curr_filename-=2;
|
||||
eof=1;
|
||||
break;
|
||||
case 'g': grab_frames=2;break;
|
||||
// pause
|
||||
case 'p':
|
||||
|
Loading…
Reference in New Issue
Block a user