Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Fix codec fps diplay for very small fps.
  lavf/mpeg: Support alaw in Hikvision CCTV recordings.
  lavf/mpeg: Support more audio codecs in Hikvision CCTV recordings.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/130/head
Michael Niedermayer 10 years ago
commit 241913c0d0
  1. 4
      libavformat/dump.c
  2. 8
      libavformat/mpeg.c

@ -118,7 +118,9 @@ void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_paylo
static void print_fps(double d, const char *postfix)
{
uint64_t v = lrintf(d * 100);
if (v % 100)
if (!v)
av_log(NULL, AV_LOG_INFO, "%1.4f %s", d, postfix);
else if (v % 100)
av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
else if (v % (100 * 1000))
av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);

@ -547,8 +547,13 @@ redo:
codec_id = AV_CODEC_ID_ADPCM_ADX;
// Auto-detect AC-3
request_probe = 50;
} else if (m->imkh_cctv && startcode == 0x1c0) {
codec_id = AV_CODEC_ID_PCM_ALAW;
request_probe = 50;
} else {
codec_id = AV_CODEC_ID_MP2;
if (m->imkh_cctv)
request_probe = 25;
}
} else if (startcode >= 0x80 && startcode <= 0x87) {
type = AVMEDIA_TYPE_AUDIO;
@ -591,7 +596,8 @@ skip:
st->id = startcode;
st->codec->codec_type = type;
st->codec->codec_id = codec_id;
if (st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) {
if ( st->codec->codec_id == AV_CODEC_ID_PCM_MULAW
|| st->codec->codec_id == AV_CODEC_ID_PCM_ALAW) {
st->codec->channels = 1;
st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 8000;

Loading…
Cancel
Save