File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 11use crate :: data:: { cli:: Args , video:: Encoding } ;
22use clap:: Parser ;
3- use data:: song:: { Song , Window } ;
3+ use data:: song:: { Song , SongError , Window } ;
44use image:: RgbImage ;
55use indicatif:: { ProgressBar , ProgressStyle } ;
66use lazy_static:: lazy_static;
@@ -46,11 +46,16 @@ fn main() {
4646 // `err` can either be the end of the song, or a genuine fault.
4747 // Either way, stop execution.
4848 if result. is_err ( ) {
49- pb. finish_with_message ( format ! ( "{:?}" , result. err( ) . unwrap( ) ) ) ;
49+ // Step 3: Flush MP4 to file
50+ encoding. flush ( ) ;
51+ pb. finish ( ) ;
52+
53+ match result. err ( ) . unwrap ( ) {
54+ SongError :: End => println ! ( "Finished rendering to {}" , & song. video_file_out) ,
55+ SongError :: Error ( err) => println ! ( "{:?}" , err) ,
56+ }
57+
5058 break ;
5159 }
5260 }
53-
54- // Step 3: Flush MP4 to file
55- encoding. flush ( ) ;
5661}
You can’t perform that action at this time.
0 commit comments