Skip to content

Commit

Permalink
fixup! ffmpeg: Fix frame dropping in filtergraph at EOF.
Browse files Browse the repository at this point in the history
  • Loading branch information
j0sh committed Sep 18, 2019
1 parent d722afc commit ab98e51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ffmpeg/ffmpeg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ func TestTranscoder_RepeatedTranscodes(t *testing.T) {
func TestTranscoder_MismatchedEncodeDecode(t *testing.T) {
// Encoded frame count does not match decoded frame count for mp4
// Note this is not an issue for mpegts! (this is sanity checked)
// See: https://github.com/livepeer/lpms/issues/155

run, dir := setupTest(t)
defer os.RemoveAll(dir)
Expand Down Expand Up @@ -1149,7 +1150,7 @@ func TestTranscoder_MismatchedEncodeDecode(t *testing.T) {
// to timestamp rounding around EOF. Note this does not happen with
// mpegts formatted output!
if res2.Decoded.Frames != 60 || res.Encoded[0].Frames != 61 {
t.Error("Did not get expected frame counts: is this fixed?!? ",
t.Error("Did not get expected frame counts: check if issue #155 is fixed!",
res2.Decoded.Frames, res.Encoded[0].Frames)
}
// Interestingly enough, ffmpeg shows that we have 61 packets but 60 frames.
Expand Down
3 changes: 1 addition & 2 deletions ffmpeg/lpms_ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,7 @@ int process_out(struct input_ctx *ictx, struct output_ctx *octx, AVCodecContext

if (!filter || !filter->active) {
// No filter in between decoder and encoder, so use input frame directly
ret = encode(encoder, inf, octx, ost);
if (ret < 0) return ret;
return encode(encoder, inf, octx, ost);
}

// Sometimes we have to reset the filter if the HW context is updated
Expand Down

0 comments on commit ab98e51

Please sign in to comment.