diff options
author | van <[email protected]> | 2008-02-29 18:33:45 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-02-29 18:33:45 +0000 |
commit | ba78192db9012c547bf78d3ef855fe473a7fb46f (patch) | |
tree | 014eb6e2239a6106619c7dc899632acc93e7cf15 /libhb/decmpeg2.c | |
parent | 10c233da4008525393ed7552a49de1008f64b7b3 (diff) |
Don't crash while scanning when we can't get previews for some title.
- if we get no previews for some title, ignore the title
- use the most common aspect ratio found from our 10 previews rather than just the aspect of preview 2 (otherwise we'll crash in hb_fix_aspect if we don't get preview 2).
- check parameters in hb_fix_aspect so we don't divide by zero.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1322 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decmpeg2.c')
-rw-r--r-- | libhb/decmpeg2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/decmpeg2.c b/libhb/decmpeg2.c index cca183697..576b04591 100644 --- a/libhb/decmpeg2.c +++ b/libhb/decmpeg2.c @@ -321,6 +321,13 @@ void hb_libmpeg2_info( hb_libmpeg2_t * m, int * width, int * height, *aspect_ratio = m->aspect_ratio; } +int hb_libmpeg2_clear_aspect_ratio( hb_libmpeg2_t * m ) +{ + int ar = m->aspect_ratio; + m->aspect_ratio = 0; + return ar; +} + /********************************************************************** * hb_libmpeg2_close ********************************************************************** |