diff options
author | eddyg <[email protected]> | 2008-12-02 01:07:02 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2008-12-02 01:07:02 +0000 |
commit | 29f8a536e11e713e6f8d983aca4405ab017a21e7 (patch) | |
tree | 108bc0a97311cdfc82ac63e27c136de60fc531ff /libhb/reader.c | |
parent | 2dddca5b3135ed939df9cdcaf2e5ffb2e4d7f44f (diff) |
Add metadata support to libhb, add importing of MP4 metadata, add export of MP4 metadata, add importing of MP4 chapters, add seek to chapter for input files, add new libmp4v2, remove old MP4 chapter muxing - now in libmp4v2.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1987 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/reader.c')
-rw-r--r-- | libhb/reader.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/libhb/reader.c b/libhb/reader.c index 911a33bd6..be7a9aecc 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -215,10 +215,32 @@ static void ReaderFunc( void * _r ) } else if ( r->stream && r->job->start_at_preview ) { + // XXX code from DecodePreviews - should go into its own routine hb_stream_seek( r->stream, (float)( r->job->start_at_preview - 1 ) / ( r->job->seek_points ? ( r->job->seek_points + 1.0 ) : 11.0 ) ); + } + else if( r->stream ) + { + /* + * Standard stream, seek to the starting chapter, if set, and track the + * end chapter so that we end at the right time. + */ + int start = r->job->chapter_start; + hb_chapter_t *chap = hb_list_item( r->title->list_chapter, chapter_end - 1 ); + + chapter_end = chap->index; + if (start > 1) + { + chap = hb_list_item( r->title->list_chapter, start - 1 ); + start = chap->index; + } + + /* + * Seek to the start chapter. + */ + hb_stream_seek_chapter( r->stream, start ); } list = hb_list_init(); @@ -228,9 +250,9 @@ static void ReaderFunc( void * _r ) while( !*r->die && !r->job->done ) { if (r->dvd) - chapter = hb_dvd_chapter( r->dvd ); + chapter = hb_dvd_chapter( r->dvd ); else if (r->stream) - chapter = 1; + chapter = hb_stream_chapter( r->stream ); if( chapter < 0 ) { |