• Marton Balint's avatar
    avformat/mpegtsenc: fix flushing of audio packets · f4eb7d84
    Marton Balint authored
    7d097a0f had the same purpose as
    3700f655 but the former is much simpler, so
    let's remove the latter.
    
    Unfortunately both checks were wrong, because in order to make sure DTS > PCR
    we have to give us some headroom, so instead of using a dts_difference <
    max_delay check let's use a dts_difference < max_delay/2 check.
    
    Fixes DTS < PCR errors with this command line:
    
    ./ffmpeg -loglevel verbose -y -f lavfi -i \
      "testsrc=s=64x64:d=20,split=2[out0][tmp1];[tmp1]vflip[out1];sine=d=20,asetnsamples=1000[out2]" \
      -flags +bitexact -fflags +bitexact -sws_flags +accurate_rnd+bitexact  \
      -codec:v libx264 -codec:a mp2 -b:a 32k -pix_fmt yuv420p \
      -map '0:v:0' \
      -map '0:v:1' \
      -map '0:a:0'  \
      -muxrate 800000 \
      -program st=0:st=2 -program st=1:st=2 -program st=2 -program st=0 -f mpegts out1.ts
    Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
    f4eb7d84
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...