[MPlayer-cvslog] CVS: main mencoder.c,1.296,1.297

Oded Shimon CVS syncmail at mplayerhq.hu
Sun Jul 17 21:28:04 CEST 2005


CVS change done by Oded Shimon CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv2348

Modified Files:
	mencoder.c 
Log Message:
-delay for MEncoder, step 5.

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -r1.296 -r1.297
--- mencoder.c	17 Jul 2005 19:27:27 -0000	1.296
+++ mencoder.c	17 Jul 2005 19:28:01 -0000	1.297
@@ -246,6 +246,10 @@
     \return The current audio pts.
 */
 static float forward_audio(float pts, demux_stream_t *d_audio, muxer_stream_t* mux_a);
+/** \brief Seeks slowly by dumping frames.
+    \return 1 for success, 2 for EOF.
+*/
+static int slowseek(float end_pts, demux_stream_t *d_video, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy, int print_info);
 
 #ifdef USE_EDL
 #include "edl.h"
@@ -1650,29 +1654,11 @@
     return a_pts;
 }
 
-#ifdef USE_EDL
-static int edl_seek(edl_record_ptr next_edl_record, demuxer_t* demuxer, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy) {
-    sh_video_t * sh_video = demuxer->video ? demuxer->video->sh : NULL;
+static int slowseek(float end_pts, demux_stream_t *d_video, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy, int print_info) {
+    sh_video_t * sh_video = d_video->sh;
     vf_instance_t * vfilter = sh_video ? sh_video->vfilter : NULL;
     int done = 0;
 
-    if (!sh_video) return 0;
-    if (sh_video->pts >= next_edl_record->stop_sec) return 1; // nothing to do...
-
-    if (!edl_seek_type) {
-        if(demux_seek(demuxer, next_edl_record->stop_sec - sh_video->pts, 0)){
-            sh_video->pts = demuxer->video->pts;
-            //if (vo_vobsub) vobsub_seek(vo_vobsub,sh_video->pts);
-            resync_video_stream(sh_video);
-            //if(vo_spudec) spudec_reset(vo_spudec);
-            return 1;
-        }
-        // non-seekable stream.
-        return 0;
-    }
-
-    // slow seek, read every frame.
-
     while (!interrupted) {
         float a_pts = 0.;
 
@@ -1686,14 +1672,14 @@
             frame_data->already_read = 1;
             if (!framecopy || (sh_video->ds->flags & 1)) return 1;
         }
-        if (sh_video->pts >= next_edl_record->stop_sec) done = 1;
+        if (sh_video->pts >= end_pts) done = 1;
 
         if (vfilter) {
             int softskip = (vfilter->control(vfilter, VFCTRL_SKIP_NEXT_FRAME, 0) == CONTROL_TRUE);
             decode_video(sh_video, frame_data->start, frame_data->in_size, !softskip);
         }
 
-        mp_msg(MSGT_MENCODER, MSGL_STATUS,
+        if (print_info) mp_msg(MSGT_MENCODER, MSGL_STATUS,
                "EDL SKIP: Start: %.2f  End: %.2lf   Current: V: %.2f  A: %.2f     \r",
                next_edl_record->start_sec, next_edl_record->stop_sec,
                sh_video->pts, a_pts);
@@ -1701,4 +1687,28 @@
     if (interrupted) return 2;
     return 1;
 }
+
+#ifdef USE_EDL
+static int edl_seek(edl_record_ptr next_edl_record, demuxer_t* demuxer, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy) {
+    sh_video_t * sh_video = demuxer->video ? demuxer->video->sh : NULL;
+
+    if (!sh_video) return 0;
+    if (sh_video->pts >= next_edl_record->stop_sec) return 1; // nothing to do...
+
+    if (!edl_seek_type) {
+        if(demux_seek(demuxer, next_edl_record->stop_sec - sh_video->pts, 0)){
+            sh_video->pts = demuxer->video->pts;
+            //if (vo_vobsub) vobsub_seek(vo_vobsub,sh_video->pts);
+            resync_video_stream(sh_video);
+            //if(vo_spudec) spudec_reset(vo_spudec);
+            return 1;
+        }
+        // non-seekable stream.
+        return 0;
+    }
+
+    // slow seek, read every frame.
+
+    return slowseek(next_edl_record->stop_sec, demuxer->video, d_audio, mux_a, frame_data, framecopy, 1);
+}
 #endif




More information about the MPlayer-cvslog mailing list