[MPlayer-cvslog] r32040 - in trunk: DOCS/tech/slave.txt help/help_mp-en.h input/input.c input/input.h mplayer.c mplayer.h
reynaldo
subversion at mplayerhq.hu
Fri Sep 3 20:50:04 CEST 2010
Author: reynaldo
Date: Fri Sep 3 20:50:03 2010
New Revision: 32040
Log:
Add new slave mode command for loading EDL file on demand.
Patch by Vlad Seryakov, vseryakov at gmail.
Modified:
trunk/DOCS/tech/slave.txt
trunk/input/input.c
trunk/input/input.h
trunk/mplayer.c
trunk/mplayer.h
Changes in other areas also in this revision:
Modified:
trunk/help/help_mp-en.h
Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt Thu Sep 2 21:48:07 2010 (r32039)
+++ trunk/DOCS/tech/slave.txt Fri Sep 3 20:50:03 2010 (r32040)
@@ -105,6 +105,9 @@ dvdnav <button_name>
prev
mouse
+edl_loadfile <filename>
+ Load new EDL file
+
edl_mark
Write the current position into the EDL file.
Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c Thu Sep 2 21:48:07 2010 (r32039)
+++ trunk/input/input.c Fri Sep 3 20:50:03 2010 (r32040)
@@ -76,6 +76,7 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_RADIO_STEP_FREQ, "radio_step_freq", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
#endif
{ MP_CMD_SEEK, "seek", 1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
+ { MP_CMD_EDL_LOADFILE, "edl_loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
{ MP_CMD_EDL_MARK, "edl_mark", 0, { {-1,{0}} } },
{ MP_CMD_AUDIO_DELAY, "audio_delay", 1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_SPEED_INCR, "speed_incr", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h Thu Sep 2 21:48:07 2010 (r32039)
+++ trunk/input/input.h Fri Sep 3 20:50:03 2010 (r32040)
@@ -61,6 +61,7 @@ typedef enum {
MP_CMD_GET_PERCENT_POS,
MP_CMD_SUB_STEP,
MP_CMD_TV_SET_CHANNEL,
+ MP_CMD_EDL_LOADFILE,
MP_CMD_EDL_MARK,
MP_CMD_SUB_ALIGNMENT,
MP_CMD_TV_LAST_CHANNEL,
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c Thu Sep 2 21:48:07 2010 (r32039)
+++ trunk/mplayer.c Fri Sep 3 20:50:03 2010 (r32040)
@@ -2533,6 +2533,17 @@ static void pause_loop(void)
#endif
}
+static void edl_loadfile(void)
+{
+ if (edl_filename) {
+ if (edl_records) {
+ free_edl(edl_records);
+ edl_needs_reset = 1;
+ }
+ next_edl_record = edl_records = edl_parse_file();
+ }
+}
+
// Execute EDL command for the current position if one exists
static void edl_update(MPContext *mpctx)
{
@@ -3211,10 +3222,7 @@ while (player_idle_mode && !filename) {
vo_wintitle = strdup ( mp_basename2 (filename));
}
-if (edl_filename) {
- if (edl_records) free_edl(edl_records);
- next_edl_record = edl_records = edl_parse_file();
-}
+ edl_loadfile();
if (edl_output_filename) {
if (edl_fd) fclose(edl_fd);
if ((edl_fd = fopen(edl_output_filename, "w")) == NULL)
@@ -3975,6 +3983,15 @@ if(step_sec>0) {
int brk_cmd = 0;
while( !brk_cmd && (cmd = mp_input_get_cmd(0,0,0)) != NULL) {
brk_cmd = run_command(mpctx, cmd);
+ if (cmd->id == MP_CMD_EDL_LOADFILE) {
+ if (edl_filename) free(edl_filename);
+ edl_filename = strdup(cmd->args[0].v.s);
+ if (edl_filename)
+ edl_loadfile();
+ else
+ mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlOutOfMemFile,
+ cmd->args[0].v.s);
+ }
mp_cmd_free(cmd);
if (brk_cmd == 2)
goto goto_enable_cache;
Modified: trunk/mplayer.h
==============================================================================
--- trunk/mplayer.h Thu Sep 2 21:48:07 2010 (r32039)
+++ trunk/mplayer.h Fri Sep 3 20:50:03 2010 (r32040)
@@ -44,7 +44,7 @@ extern char * filename;
extern int stream_cache_size;
extern int autosync;
-
+extern double start_pts;
extern int frame_dropping;
extern int auto_quality;
More information about the MPlayer-cvslog
mailing list