summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-11-25 21:14:44 +0000
committerjstebbins <[email protected]>2009-11-25 21:14:44 +0000
commit009238a822971a933d0b7642fd04c15bf8e404a2 (patch)
tree0979d88ba5116f4ad7e41f55bc7f93a1a82040b9 /libhb/reader.c
parent08483929dd5352012eb8b1f1143f138e3d5f19f0 (diff)
batch file scanning and scan cancel
When a directory is specified as the source, first we attempt to open as a dvd, then if that fails, we attempt to open each file in the directory as a stream source. Since opening a large directory of files can take a really long time, you can also now cancel a scan. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2980 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/reader.c')
-rw-r--r--libhb/reader.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libhb/reader.c b/libhb/reader.c
index 1dda826d0..94ee77efb 100644
--- a/libhb/reader.c
+++ b/libhb/reader.c
@@ -194,12 +194,20 @@ static void ReaderFunc( void * _r )
int chapter = -1;
int chapter_end = r->job->chapter_end;
- if( !( r->dvd = hb_dvd_init( r->title->dvd ) ) )
+ if ( r->title->type == HB_DVD_TYPE )
{
- if ( !( r->stream = hb_stream_open( r->title->dvd, r->title ) ) )
- {
- return;
- }
+ if ( !( r->dvd = hb_dvd_init( r->title->path ) ) )
+ return;
+ }
+ else if ( r->title->type == HB_STREAM_TYPE )
+ {
+ if ( !( r->stream = hb_stream_open( r->title->path, r->title ) ) )
+ return;
+ }
+ else
+ {
+ // Unknown type, should never happen
+ return;
}
if (r->dvd)