fixed skindesigner

This commit is contained in:
jojo61 2018-08-31 23:08:30 +02:00
parent c3119bddae
commit e7b644d59a
1 changed files with 25 additions and 19 deletions

44
video.c
View File

@ -582,9 +582,9 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width,
} }
display_aspect_ratio.num = display_aspect_ratio.num =
VideoScreen->width_in_pixels * VideoScreen->height_in_millimeters; VideoScreen->width_in_pixels; // * VideoScreen->height_in_millimeters;
display_aspect_ratio.den = display_aspect_ratio.den =
VideoScreen->height_in_pixels * VideoScreen->width_in_millimeters; VideoScreen->height_in_pixels; // * VideoScreen->width_in_millimeters;
display_aspect_ratio = av_mul_q(input_aspect_ratio, display_aspect_ratio); display_aspect_ratio = av_mul_q(input_aspect_ratio, display_aspect_ratio);
Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num, Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num,
@ -604,17 +604,17 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width,
display_aspect_ratio.den); display_aspect_ratio.den);
#endif #endif
if (!av_cmp_q(input_aspect_ratio, tmp_ratio)) { if (!av_cmp_q(input_aspect_ratio, tmp_ratio)) {
switch (Video4to3ZoomMode) { switch (Video4to3ZoomMode) {
case VideoNormal: case VideoNormal:
goto normal; goto normal;
case VideoStretch: case VideoStretch:
goto stretch; goto stretch;
case VideoCenterCutOut: case VideoCenterCutOut:
goto center_cut_out; goto center_cut_out;
case VideoAnamorphic: case VideoAnamorphic:
// FIXME: rest should be done by hardware // FIXME: rest should be done by hardware
goto stretch; goto stretch;
} }
} }
switch (VideoOtherZoomMode) { switch (VideoOtherZoomMode) {
case VideoNormal: case VideoNormal:
@ -806,6 +806,7 @@ static void GlxSetupDecoder(int width, int height, GLuint * textures)
static inline void GlxRenderTexture(GLuint texture, int x, int y, int width, static inline void GlxRenderTexture(GLuint texture, int x, int y, int width,
int height) int height)
{ {
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture); glBindTexture(GL_TEXTURE_2D, texture);
@ -2904,6 +2905,7 @@ static void CuvidMixVideo(CuvidDecoder * decoder, int level)
VdpRect dst_video_rect; VdpRect dst_video_rect;
int w = decoder->InputWidth; int w = decoder->InputWidth;
int h = decoder->InputHeight; int h = decoder->InputHeight;
int y;
CUgraphicsResource cuResource; CUgraphicsResource cuResource;
CUcontext dummy=NULL; CUcontext dummy=NULL;
GLint texLoc; GLint texLoc;
@ -2944,7 +2946,12 @@ static void CuvidMixVideo(CuvidDecoder * decoder, int level)
// Render Progressive frame and simple interlaced // Render Progressive frame and simple interlaced
glViewport(decoder->OutputX, decoder->OutputY, decoder->OutputWidth, decoder->OutputHeight); //printf("decoder Y %d\n",decoder->OutputY);
y = VideoWindowHeight - decoder->OutputY - decoder->OutputHeight;
if (y <0 )
y = 0;
glViewport(decoder->OutputX, y, decoder->OutputWidth, decoder->OutputHeight);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
@ -3111,10 +3118,8 @@ static void CuvidDisplayFrame(void)
glXMakeCurrent(XlibDisplay, VideoWindow, GlxSharedContext); glXMakeCurrent(XlibDisplay, VideoWindow, GlxSharedContext);
// printf("Frame %d display time %ld \n",Count, (uint64_t)(GetusTicks()-last_time)/1000);
glXWaitVideoSyncSGI (2, (Count + 1) % 2, &Count); // wait for previous frame to swap glXWaitVideoSyncSGI (2, (Count + 1) % 2, &Count); // wait for previous frame to swap
glClear(GL_COLOR_BUFFER_BIT);
last_time = GetusTicks();
// //
// Render videos into output // Render videos into output
// //
@ -3143,7 +3148,8 @@ static void CuvidDisplayFrame(void)
// //
if (OsdShown) { if (OsdShown) {
glXMakeCurrent(XlibDisplay, VideoWindow, GlxThreadContext); glXMakeCurrent(XlibDisplay, VideoWindow, GlxThreadContext);
GlxRenderTexture(OsdGlTextures[OsdIndex], decoder->OutputX, decoder->OutputY, decoder->OutputWidth, decoder->OutputHeight); // GlxRenderTexture(OsdGlTextures[OsdIndex], decoder->OutputX, decoder->OutputY, decoder->OutputWidth, decoder->OutputHeight);
GlxRenderTexture(OsdGlTextures[OsdIndex], 0,0, VideoWindowWidth, VideoWindowHeight);
glXMakeCurrent(XlibDisplay, VideoWindow, GlxSharedContext); glXMakeCurrent(XlibDisplay, VideoWindow, GlxSharedContext);
// FIXME: toggle osd // FIXME: toggle osd
} }
@ -3339,7 +3345,7 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
++decoder->FramesDuped; ++decoder->FramesDuped;
decoder->SyncCounter = 1; decoder->SyncCounter = 1;
goto out; goto out;
} else if (diff < -25 * 90 && filled > 1 + 2 * decoder->Interlaced) { } else if (diff < -25 * 90 && filled > 3 + 2 * decoder->Interlaced) {
err = CuvidMessage(3, "video: speed up video, droping frame\n"); err = CuvidMessage(3, "video: speed up video, droping frame\n");
++decoder->FramesDropped; ++decoder->FramesDropped;
CuvidAdvanceDecoderFrame(decoder); CuvidAdvanceDecoderFrame(decoder);