mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
				synced 2023-10-10 17:16:51 +00:00 
			
		
		
		
	Fix bug: AVCodecContext.framerate not supported.
Older versions of ffmpeg have no member framerate in AVCodecContext.
This commit is contained in:
		
							
								
								
									
										5
									
								
								video.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								video.c
									
									
									
									
									
								
							| @@ -456,6 +456,10 @@ static void VideoSetPts(int64_t * pts_p, int interlaced, | ||||
|     //	Get duration for this frame. | ||||
|     //	FIXME: using framerate as workaround for av_frame_get_pkt_duration | ||||
|     // | ||||
| #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56,13,100) | ||||
|     // FIXME: need frame rate for older versions | ||||
|     duration = interlaced ? 40 : 20;	// 50Hz -> 20ms default | ||||
| #else | ||||
|     if (video_ctx->framerate.num != 0 && video_ctx->framerate.den != 0) { | ||||
| 	duration = 1000 * video_ctx->framerate.den / video_ctx->framerate.num; | ||||
|     } else { | ||||
| @@ -463,6 +467,7 @@ static void VideoSetPts(int64_t * pts_p, int interlaced, | ||||
|     } | ||||
|     Debug(4, "video: %d/%d %" PRIx64 " -> %d\n", video_ctx->framerate.den, | ||||
| 	video_ctx->framerate.num, av_frame_get_pkt_duration(frame), duration); | ||||
| #endif | ||||
|  | ||||
|     // update video clock | ||||
|     if (*pts_p != (int64_t) AV_NOPTS_VALUE) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user