Skip to content

Commit

Permalink
[3d] fixed wrong size of ass subtitles under sbs/tab 3d mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
taxigps committed Sep 8, 2013
1 parent c4622ca commit d67d6ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
Expand Up @@ -25,6 +25,7 @@
#include "utils/log.h"
#include "threads/SingleLock.h"
#include "threads/Atomics.h"
#include "guilib/GraphicContext.h"

using namespace std;

Expand Down Expand Up @@ -159,7 +160,9 @@ ASS_Image* CDVDSubtitlesLibass::RenderImage(int imageWidth, int imageHeight, dou
return NULL;
}

double storage_aspact = (double)imageWidth / imageHeight;
m_dll.ass_set_frame_size(m_renderer, imageWidth, imageHeight);
m_dll.ass_set_aspect_ratio(m_renderer, storage_aspact / g_graphicsContext.GetResInfo().fPixelRatio, storage_aspact);
return m_dll.ass_render_frame(m_renderer, m_track, DVD_TIME_TO_MSEC(pts), changes);
}

Expand Down
3 changes: 3 additions & 0 deletions xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
Expand Up @@ -50,6 +50,7 @@ class DllLibassInterface
virtual ASS_Library* ass_library_init(void)=0;
virtual ASS_Renderer* ass_renderer_init(ASS_Library* library)=0;
virtual void ass_set_frame_size(ASS_Renderer* priv, int w, int h)=0;
virtual void ass_set_aspect_ratio(ASS_Renderer* priv, double dar, double sar)=0;
virtual void ass_set_margins(ASS_Renderer* priv, int t, int b, int l, int r)=0;
virtual void ass_set_use_margins(ASS_Renderer* priv, int use)=0;
virtual void ass_set_font_scale(ASS_Renderer* priv, double font_scale)=0;
Expand All @@ -76,6 +77,7 @@ class DllLibass : public DllDynamic, DllLibassInterface
DEFINE_METHOD0(ASS_Library *, ass_library_init)
DEFINE_METHOD1(ASS_Renderer *, ass_renderer_init, (ASS_Library * p1))
DEFINE_METHOD3(void, ass_set_frame_size, (ASS_Renderer * p1, int p2, int p3))
DEFINE_METHOD3(void, ass_set_aspect_ratio, (ASS_Renderer * p1, double p2, double p3))
DEFINE_METHOD5(void, ass_set_margins, (ASS_Renderer * p1, int p2, int p3, int p4, int p5))
DEFINE_METHOD2(void, ass_set_use_margins, (ASS_Renderer * p1, int p2))
DEFINE_METHOD2(void, ass_set_font_scale, (ASS_Renderer * p1, double p2))
Expand All @@ -97,6 +99,7 @@ class DllLibass : public DllDynamic, DllLibassInterface
RESOLVE_METHOD(ass_library_init)
RESOLVE_METHOD(ass_renderer_init)
RESOLVE_METHOD(ass_set_frame_size)
RESOLVE_METHOD(ass_set_aspect_ratio)
RESOLVE_METHOD(ass_set_margins)
RESOLVE_METHOD(ass_set_use_margins)
RESOLVE_METHOD(ass_set_font_scale)
Expand Down

0 comments on commit d67d6ea

Please sign in to comment.