mirror of
				https://github.com/jojo61/vdr-plugin-softhdcuvid.git
				synced 2025-03-01 10:39:28 +00:00 
			
		
		
		
	deinterlace fpr mpeg2 is broken
This commit is contained in:
		
							
								
								
									
										30
									
								
								codec.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								codec.c
									
									
									
									
									
								
							| @@ -313,16 +313,26 @@ void CodecVideoOpen(VideoDecoder * decoder, int codec_id) | |||||||
|     pthread_mutex_lock(&CodecLockMutex); |     pthread_mutex_lock(&CodecLockMutex); | ||||||
|     // open codec |     // open codec | ||||||
|  |  | ||||||
|      | 	if (name && strcmp(name,"mpeg2_cuvid") == 0) {  // deinterlace for mpeg2 is somehow broken  | ||||||
|     if (av_opt_set_int(decoder->VideoCtx->priv_data, "deint", 2 ,0) < 0) { | 			if (av_opt_set_int(decoder->VideoCtx->priv_data, "deint", 0 ,0) < 0) {  // weave | ||||||
|   	  pthread_mutex_unlock(&CodecLockMutex); | 		  pthread_mutex_unlock(&CodecLockMutex); | ||||||
| 	  Fatal(_("codec: can't set option deint to video codec!\n")); | 		  Fatal(_("codec: can't set option deint to video codec!\n")); | ||||||
|     } | 		} | ||||||
|  | 		if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false" ,0) < 0) { | ||||||
|     if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false" ,0) < 0) { | 		  pthread_mutex_unlock(&CodecLockMutex); | ||||||
|   	  pthread_mutex_unlock(&CodecLockMutex); | 		  Fatal(_("codec: can't set option drop 2.field to video codec!\n")); | ||||||
| 	  Fatal(_("codec: can't set option drop 2.field  to video codec!\n")); | 		} | ||||||
|     } | 	} | ||||||
|  | 	else { | ||||||
|  | 		if (av_opt_set_int(decoder->VideoCtx->priv_data, "deint", 2 ,0) < 0) { // adaptive | ||||||
|  | 		  pthread_mutex_unlock(&CodecLockMutex); | ||||||
|  | 		  Fatal(_("codec: can't set option deint to video codec!\n")); | ||||||
|  | 		} | ||||||
|  | 		if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false" ,0) < 0) { | ||||||
|  | 		  pthread_mutex_unlock(&CodecLockMutex); | ||||||
|  | 		  Fatal(_("codec: can't set option drop 2.field  to video codec!\n")); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
|     if ((ret = avcodec_open2(decoder->VideoCtx, video_codec, NULL)) < 0) { |     if ((ret = avcodec_open2(decoder->VideoCtx, video_codec, NULL)) < 0) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user