summaryrefslogtreecommitdiffstats
path: root/common/av_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-24 20:12:26 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commit6d11668a9c448674ac04ef61bf902c867671d8db (patch)
tree34336a83e651cebbbde0b089587dc3c37dea1d77 /common/av_common.c
parent327f3fc848e6e30d431411e103e10dbae7f461e3 (diff)
downloadmpv-6d11668a9c448674ac04ef61bf902c867671d8db.tar.bz2
mpv-6d11668a9c448674ac04ef61bf902c867671d8db.tar.xz
demux: use no overlapping packets for lossless audio
Worthless optimization, but at least it justifies that the --audio-backward-overlap option has an "auto" choice. Tested with PCM and FLAC.
Diffstat (limited to 'common/av_common.c')
-rw-r--r--common/av_common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/av_common.c b/common/av_common.c
index 3ea1ceb872..01428ff2f4 100644
--- a/common/av_common.c
+++ b/common/av_common.c
@@ -292,6 +292,13 @@ const char *mp_codec_from_av_codec_id(int codec_id)
return name;
}
+bool mp_codec_is_lossless(const char *codec)
+{
+ const AVCodecDescriptor *desc =
+ avcodec_descriptor_get(mp_codec_to_av_codec_id(codec));
+ return desc && (desc->props & AV_CODEC_PROP_LOSSLESS);
+}
+
// kv is in the format as by OPT_KEYVALUELIST(): kv[0]=key0, kv[1]=val0, ...
// Copy them to the dict.
void mp_set_avdict(AVDictionary **dict, char **kv)