diff options
author | jstebbins <[email protected]> | 2010-09-08 16:51:59 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-09-08 16:51:59 +0000 |
commit | a007891bf9f7e53d3705c51b5b41f9e56a144031 (patch) | |
tree | b7a532c24a458d549afb0174c374e631b896a46e /libhb/decavcodec.c | |
parent | 772c3574758e9bc29cb76bbc86343cf9ad5ddd71 (diff) |
Add Bluray support
Unencrypted BD directory trees only. Doesn't support iso images.
Also, no PGS subtitle support yet.
Chapters and angles are supported.
Adds a new contrib libbluray.
Adds new option to hb_scan() for duration of short titles to filter.
This applies to BD and DVD multi-title scans only. Does not apply
to any single title scans.
Fixes memory leak during scan. hb_buffer_close() was not freeing
all buffers in a chain of buffers passed to it.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3510 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 09f15ecd8..f5c46699e 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -533,7 +533,12 @@ static int reget_frame_buf( AVCodecContext *context, AVFrame *frame ) static void log_chapter( hb_work_private_t *pv, int chap_num, int64_t pts ) { - hb_chapter_t *c = hb_list_item( pv->job->title->list_chapter, chap_num - 1 ); + hb_chapter_t *c; + + if ( !pv->job ) + return; + + c = hb_list_item( pv->job->title->list_chapter, chap_num - 1 ); if ( c && c->title ) { hb_log( "%s: \"%s\" (%d) at frame %u time %"PRId64, @@ -648,6 +653,17 @@ static int decodeFrame( hb_work_private_t *pv, uint8_t *data, int size, int sequ buf = copy_frame( pv, &frame ); buf->start = pts; buf->sequence = sequence; + if ( pv->new_chap && buf->start >= pv->chap_time ) + { + buf->new_chap = pv->new_chap; + pv->new_chap = 0; + pv->chap_time = 0; + log_chapter( pv, buf->new_chap, buf->start ); + } + else if ( pv->nframes == 0 && pv->job ) + { + log_chapter( pv, pv->job->chapter_start, buf->start ); + } hb_list_add( pv->list, buf ); ++pv->nframes; return got_picture; @@ -687,7 +703,7 @@ static int decodeFrame( hb_work_private_t *pv, uint8_t *data, int size, int sequ pv->chap_time = 0; log_chapter( pv, buf->new_chap, buf->start ); } - else if ( pv->nframes == 0 ) + else if ( pv->nframes == 0 && pv->job ) { log_chapter( pv, pv->job->chapter_start, buf->start ); } |