File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,9 @@ impl<T: Pixel> Context<T> {
64
64
///
65
65
/// # Errors
66
66
///
67
- /// If this method is called with a frame after the encoder has been flushed,
68
- /// the [`EncoderStatus::EnoughData`] error is returned.
67
+ /// If this method is called with a frame after the encoder has been flushed
68
+ /// or the encoder internal limit is hit (`std::i32::MAX` frames) the
69
+ /// [`EncoderStatus::EnoughData`] error is returned.
69
70
///
70
71
/// # Examples
71
72
///
@@ -109,7 +110,12 @@ impl<T: Pixel> Context<T> {
109
110
self . is_flushing = true ;
110
111
} else if self . is_flushing {
111
112
return Err ( EncoderStatus :: EnoughData ) ;
113
+ // The rate control can process at most std::i32::MAX frames
114
+ } else if self . inner . frame_count == std:: i32:: MAX as u64 - 1 {
115
+ self . inner . limit = Some ( self . inner . frame_count ) ;
116
+ self . is_flushing = true ;
112
117
}
118
+
113
119
let inner = & mut self . inner ;
114
120
let pool = & mut self . pool ;
115
121
You can’t perform that action at this time.
0 commit comments