summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-01-19 06:49:47 +0200
committerUoti Urpala <uau@mplayer2.org>2012-03-09 20:48:54 +0200
commit7576885677764a71fe03cec5f697f8a28f9365c8 (patch)
treee93b5c8469cbfc1ac6fc60684f5564a8f6a95be8 /mplayer.c
parent8a6b0b813a1431ca50986c90d97b72fa6640dbea (diff)
downloadmpv-7576885677764a71fe03cec5f697f8a28f9365c8.tar.bz2
mpv-7576885677764a71fe03cec5f697f8a28f9365c8.tar.xz
core: remove old EDL mode (--edl option)
Remove the old EDL implementation that was activated with the --edl option. It is mostly redundant and inferior compared to the newer demux_edl support, though currently there's no support for using the same EDL files with the new implementation and the mute functionality of the old implementation is not supported. The main reason to remove the old implementation at this point is that the mute functionality would conflict with following audio volume handling changes, and working on the old code would be a wasted effort in the long run as at some point it would be removed anyway. The --edlout functionality is kept for now, even though after this commit there is no code that could directly read its output.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c78
1 files changed, 5 insertions, 73 deletions
diff --git a/mplayer.c b/mplayer.c
index f8b24a1285..19d93bf2d8 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -90,8 +90,6 @@
#include "codec-cfg.h"
-#include "edl.h"
-
#include "sub/spudec.h"
#include "sub/vobsub.h"
@@ -336,9 +334,9 @@ char *current_module; // for debugging
// ---
-edl_record_ptr edl_records = NULL; ///< EDL entries memory area
-edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records
FILE *edl_fd; // file to write to when in -edlout mode.
+char *edl_output_filename; // file to put EDL entries in (-edlout)
+
int use_filedir_conf;
int use_filename_title;
@@ -683,8 +681,6 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
if (mask & INITIALIZED_AO) {
mpctx->initialized_flags &= ~INITIALIZED_AO;
current_module = "uninit_ao";
- if (mpctx->edl_muted)
- mixer_mute(&mpctx->mixer);
if (mpctx->ao)
ao_uninit(mpctx->ao, mpctx->stop_play != AT_END_OF_FILE);
mpctx->ao = NULL;
@@ -695,7 +691,7 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc)
{
- if (mpctx->user_muted && !mpctx->edl_muted)
+ if (mpctx->user_muted)
mixer_mute(&mpctx->mixer);
uninit_player(mpctx, INITIALIZED_ALL);
#if defined(__MINGW32__) || defined(__CYGWIN__)
@@ -734,8 +730,6 @@ void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc)
talloc_free(mpctx->key_fifo);
- free(edl_records); // free mem allocated for EDL
- edl_records = NULL;
switch (how) {
case EXIT_QUIT:
mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "\nExiting... (%s)\n", "Quit");
@@ -3107,59 +3101,6 @@ static void pause_loop(struct MPContext *mpctx)
}
}
-
-// Find the right mute status and record position for new file position
-static void edl_seek_reset(MPContext *mpctx)
-{
- mpctx->edl_muted = 0;
- next_edl_record = edl_records;
-
- while (next_edl_record) {
- if (next_edl_record->start_sec >= get_current_time(mpctx))
- break;
-
- if (next_edl_record->action == EDL_MUTE)
- mpctx->edl_muted = !mpctx->edl_muted;
- next_edl_record = next_edl_record->next;
- }
- if ((mpctx->user_muted | mpctx->edl_muted) != mpctx->mixer.muted)
- mixer_mute(&mpctx->mixer);
-}
-
-
-// Execute EDL command for the current position if one exists
-static void edl_update(MPContext *mpctx)
-{
- if (!next_edl_record)
- return;
-
- if (!mpctx->sh_video) {
- mp_tmsg(MSGT_CPLAYER, MSGL_ERR,
- "Cannot use EDL without video, disabling.\n");
- free_edl(edl_records);
- next_edl_record = NULL;
- edl_records = NULL;
- return;
- }
-
- if (get_current_time(mpctx) >= next_edl_record->start_sec) {
- if (next_edl_record->action == EDL_SKIP) {
- mpctx->osd_function = OSD_FFW;
- queue_seek(mpctx, MPSEEK_RELATIVE, next_edl_record->length_sec, 0);
- mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_SKIP: start [%f], stop "
- "[%f], length [%f]\n", next_edl_record->start_sec,
- next_edl_record->stop_sec, next_edl_record->length_sec);
- } else if (next_edl_record->action == EDL_MUTE) {
- mpctx->edl_muted = !mpctx->edl_muted;
- if ((mpctx->user_muted | mpctx->edl_muted) != mpctx->mixer.muted)
- mixer_mute(&mpctx->mixer);
- mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_MUTE: [%f]\n",
- next_edl_record->start_sec);
- }
- next_edl_record = next_edl_record->next;
- }
-}
-
static void reinit_decoders(struct MPContext *mpctx)
{
reinit_video_chain(mpctx);
@@ -3181,8 +3122,8 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao)
mpctx->time_frame = 0;
mpctx->restart_playback = true;
// Not all demuxers set d_video->pts during seek, so this value
- // (which is used by at least vobsub and edl code below) may
- // be completely wrong (probably 0).
+ // (which is used by at least vobsub code below) may be completely
+ // wrong (probably 0).
mpctx->sh_video->pts = mpctx->d_video->pts + mpctx->video_offset;
mpctx->video_pts = mpctx->sh_video->pts;
update_subtitles(mpctx, mpctx->sh_video->pts, mpctx->video_offset,
@@ -3207,8 +3148,6 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao)
vobsub_seek(vo_vobsub, mpctx->sh_video->pts);
}
- edl_seek_reset(mpctx);
-
mpctx->hrseek_active = false;
mpctx->hrseek_framedrop = false;
mpctx->total_avsync_change = 0;
@@ -3851,8 +3790,6 @@ static void run_playloop(struct MPContext *mpctx)
queue_seek(mpctx, MPSEEK_RELATIVE, step_sec, 0);
}
- edl_update(mpctx);
-
/* Looping. */
if (opts->loop_times >= 0 && (mpctx->stop_play == AT_END_OF_FILE ||
mpctx->stop_play == PT_NEXT_ENTRY)) {
@@ -4401,11 +4338,6 @@ play_next_file:
mp_basename(mpctx->filename));
}
- if (edl_filename) {
- if (edl_records)
- free_edl(edl_records);
- next_edl_record = edl_records = edl_parse_file();
- }
if (edl_output_filename) {
if (edl_fd)
fclose(edl_fd);