[MEncoder-users] Trimming video

Oded Shimon ods15 at ods15.dyndns.org
Sat Jun 25 10:27:45 CEST 2005


On Fri, Jun 24, 2005 at 10:25:56PM -0500, Pete Davis wrote:
> Oded,
> 
> Trying to cut the beginning (at 0 seconds), is definitely causing a
> segmentation fault. Starting the cut after that works, but it's encoding
> less than 1 second of video.

Thanks for the bug report, you found a nasty bug in MEncoder's EDL seek.
I think I only half-fixed it so far, because i still get a segfault when I 
use mp3lame. I'm gonna keep looking. In the meanwhile, this patch will 
probably help you.

- ods15
-------------- next part --------------
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.288
diff -u -r1.288 mencoder.c
--- mencoder.c	1 Jun 2005 09:01:41 -0000	1.288
+++ mencoder.c	25 Jun 2005 08:25:40 -0000
@@ -239,7 +239,7 @@
 static short edl_muted; ///< Stores whether EDL is currently in muted mode.
 static short edl_seeking; ///< When non-zero, stream is seekable.
 static short edl_seek_type; ///< When non-zero, frames are discarded instead of seeking.
-static short edl_skip; ///< -1 OR the value of in_size of an already read frame.
+static int edl_skip; ///< -1 OR the value of in_size of an already read frame.
 /** \brief Seeks for EDL
     \return 1 for success, 0 for failure, 2 for EOF.
 */
@@ -1045,7 +1045,7 @@
 
             result = edl_seek(next_edl_record, demuxer, d_audio, mux_a, &frame_time, &start, mux_v->codec==VCODEC_COPY);
 
-            if (result == 2) break; // EOF
+            if (result == 2) { at_eof=1; break; } // EOF
             else if (result == 0) edl_seeking = 0; // no seeking
             else { // sucess
                 edl_muted = 0;


More information about the MEncoder-users mailing list