Hi,

for some reason requested frame in the beginning of consumer thread is NULL, so it makes a SIGSEGV on requesting vitc from that frame:

(gdb) bt
#0 mlt_properties_find (self=0x0, name=0x7fffef5adae0 "meta.attr.vitc.markup") at mlt_properties.c:484 #1 mlt_properties_get (self=0x0, name=0x7fffef5adae0 "meta.attr.vitc.markup") at mlt_properties.c:750 #2 0x00007fffef5aa4a9 in consumer_thread (arg=0x693960) at consumer_avformat.c:1286
#3  0x0000003a71006ccb in start_thread () from /lib64/libpthread.so.0
#4  0x0000003a70ce0c2d in clone () from /lib64/libc.so.6

the solution is to check if frame is defined.

patch attached.

--
________________________________________
Maksym Veremeyenko
>From e030af1d205b1cac9e4bca5b7742fd24e1569126 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1stereo.tv>
Date: Mon, 16 Jan 2012 14:41:19 +0200
Subject: [PATCH 4/5] check if frame is not NULL before extrating timecode

---
 src/modules/avformat/consumer_avformat.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index 5665ba9..050cc70 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -1282,6 +1282,8 @@ static void *consumer_thread( void *arg )
 	// Get a frame now, so we can set some AVOptions from properties.
 	frame = mlt_consumer_rt_frame( consumer );
 
+	if ( frame )
+	{
 	// Set the timecode from the MLT metadata if available.
 	const char *timecode = mlt_properties_get( MLT_FRAME_PROPERTIES(frame), "meta.attr.vitc.markup" );
 	if ( timecode && strcmp( timecode, "" ) )
@@ -1290,6 +1292,7 @@ static void *consumer_thread( void *arg )
 		if ( strchr( timecode, ';' ) )
 			mlt_properties_set_int( properties, "drop_frame_timecode", 1 );
 	}
+	}
 
 	// Add audio and video streams
 	if ( video_codec_id != CODEC_ID_NONE )
-- 
1.7.4.4

>From 9d1967a21199047d0b1728c3c19ec3409ab1abdb Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1stereo.tv>
Date: Mon, 16 Jan 2012 15:06:06 +0200
Subject: [PATCH 5/5] reindent after previous patch

---
 src/modules/avformat/consumer_avformat.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index 050cc70..44dbe53 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -1284,14 +1284,14 @@ static void *consumer_thread( void *arg )
 
 	if ( frame )
 	{
-	// Set the timecode from the MLT metadata if available.
-	const char *timecode = mlt_properties_get( MLT_FRAME_PROPERTIES(frame), "meta.attr.vitc.markup" );
-	if ( timecode && strcmp( timecode, "" ) )
-	{
-		mlt_properties_set( properties, "timecode", timecode );
-		if ( strchr( timecode, ';' ) )
-			mlt_properties_set_int( properties, "drop_frame_timecode", 1 );
-	}
+		// Set the timecode from the MLT metadata if available.
+		const char *timecode = mlt_properties_get( MLT_FRAME_PROPERTIES(frame), "meta.attr.vitc.markup" );
+		if ( timecode && strcmp( timecode, "" ) )
+		{
+			mlt_properties_set( properties, "timecode", timecode );
+			if ( strchr( timecode, ';' ) )
+				mlt_properties_set_int( properties, "drop_frame_timecode", 1 );
+		}
 	}
 
 	// Add audio and video streams
-- 
1.7.4.4

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to