Hi,
the attached patch should fix this bug.

-- 
Anton Khirnov
Index: kino-1.3.4/src/frame.cc
===================================================================
--- kino-1.3.4.orig/src/frame.cc	2014-03-01 07:45:28.394100209 +0000
+++ kino-1.3.4/src/frame.cc	2014-03-01 07:50:16.111211573 +0000
@@ -102,7 +102,7 @@
 	pthread_mutex_lock( &avcodec_mutex );
 	av_register_all();
 	libavcodec = avcodec_alloc_context3(NULL);
-	avcodec_open2( libavcodec, avcodec_find_decoder( CODEC_ID_DVVIDEO ), NULL );
+	avcodec_open2( libavcodec, avcodec_find_decoder( AV_CODEC_ID_DVVIDEO ), NULL );
 	pthread_mutex_unlock( &avcodec_mutex );
 	data = ( unsigned char* ) av_mallocz( 144000 );
 #if defined(HAVE_SWSCALE)
@@ -1340,7 +1340,7 @@
 			avformatEncoder->oformat = av_guess_format( "dv", NULL, NULL );
 			AVStream* vst = avformat_new_stream( avformatEncoder, NULL );
 			vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-			vst->codec->codec_id = CODEC_ID_DVVIDEO;
+			vst->codec->codec_id = AV_CODEC_ID_DVVIDEO;
 			vst->codec->bit_rate = 25000000;
 			vst->start_time = 0;
 			AVCodecContext *avcodecEncoder = vst->codec;
@@ -1367,8 +1367,7 @@
 			avcodecEncoder->time_base= isPAL ? ( AVRational ){ 1, 25 } : ( AVRational ){ 1001, 30000 };
 			avcodecEncoder->pix_fmt = isPAL ? PIX_FMT_YUV420P : PIX_FMT_YUV411P;
 			avcodecEncoder->flags |= CODEC_FLAG_INTERLACED_DCT;
-			avcodec_open2( avcodecEncoder, avcodec_find_encoder( CODEC_ID_DVVIDEO ), NULL );
-			av_new_packet( &avpacketEncoder, 144000 );
+			avcodec_open2( avcodecEncoder, avcodec_find_encoder( AV_CODEC_ID_DVVIDEO ), NULL );
 			tempImage = ( uint8_t* ) av_malloc(
 				avpicture_get_size( avcodecEncoder->pix_fmt, avcodecEncoder->width, avcodecEncoder->height ) );
 #if defined(HAVE_SWSCALE)
@@ -1460,6 +1459,7 @@
 			int width = avcodecEncoder->width;
 			int height = avcodecEncoder->height;
 			size_t size = height > 480 ? 144000 : 120000;
+			int ret, got_output;
 
 			// Convert color space
 			avpicture_fill( ( AVPicture* )output, tempImage, avcodecEncoder->pix_fmt, width, height );
@@ -1472,9 +1472,10 @@
 #endif
 
 			// Encode
-			bytesInFrame = avcodec_encode_video( avcodecEncoder, avpacketEncoder.data, size, output );
-			avformatEncoder->pb = avio_alloc_context(data, bytesInFrame, 0, NULL, NULL, NULL, NULL);
-			avpacketEncoder.size = bytesInFrame;
+			ret = avcodec_encode_video2( avcodecEncoder, &avpacketEncoder, output, &got_output);
+			if (ret < 0 || !got_output)
+			    return;
+			avformatEncoder->pb = avio_alloc_context(data, avpacketEncoder.size, 0, NULL, NULL, NULL, NULL);
 			if ( !isEncoderHeaderWritten )
 			{
 				avformat_write_header(avformatEncoder, NULL);

Reply via email to