diff --git a/ffmpeg.c b/ffmpeg.c
index 325ffb1d2f3e44c195a0be920efc6c44ab8735fc..2253fc5777194505397ad07b2076ab276e48cfa5 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2236,9 +2236,6 @@ static int av_encode(AVFormatContext **output_files,
             ist = ist_table[ost->source_index];
             if(no_packet[ist->file_index])
                 continue;
-            if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO)
-                opts = ost->sync_opts * av_q2d(ost->st->codec->time_base);
-            else
                 opts = ost->st->pts.val * av_q2d(ost->st->time_base);
             ipts = (double)ist->pts;
             if (!file_table[ist->file_index].eof_reached){
diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm
index de91680556e32f053f71627773e41f465f1320f1..e833944dbf42e3c2338d0001e21f8859843a2622 100644
--- a/tests/ref/lavf/ffm
+++ b/tests/ref/lavf/ffm
@@ -1,3 +1,3 @@
-a2dd3180dbfc7c8d50d34cea4cdc92d8 *./tests/data/b-lavf.ffm
+03fc7f90bba9361cf6128cd4655fb20f *./tests/data/b-lavf.ffm
 376832 ./tests/data/b-lavf.ffm
-./tests/data/b-lavf.ffm CRC=0x2b39ed74
+./tests/data/b-lavf.ffm CRC=0xf361ed74