Commit f2ea2f0
committed
fix(replay): Skip MediaMuxer stop when no samples were written
MediaMuxer.stop() throws IllegalStateException when the muxer was started
but no sample was ever written to its track. SimpleMp4FrameMuxer.release()
only guarded against the never-started case, so a started-but-empty muxer
made release() throw.
Because release() runs from SimpleVideoEncoder's finally block, that throw
propagates out to createVideoOf, which treats release() as safe cleanup;
the encoder is left dangling and the orphan video file is never deleted.
Only call stop() when at least one sample was written; muxer.release() on a
started-but-not-stopped muxer is safe.1 parent 45b652d commit f2ea2f0
1 file changed
Lines changed: 3 additions & 3 deletions
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments