Revision 1a5e4fd8 libavcodec/ac3enc.c

View differences:

libavcodec/ac3enc.c
33 33

  
34 34
#include "libavutil/audioconvert.h"
35 35
#include "libavutil/avassert.h"
36
#include "libavutil/avstring.h"
36 37
#include "libavutil/crc.h"
37 38
#include "libavutil/opt.h"
38 39
#include "avcodec.h"
......
1578 1579
    char strbuf[32];
1579 1580

  
1580 1581
    switch (s->bitstream_id) {
1581
    case  6:  strncpy(strbuf, "AC-3 (alt syntax)", 32);      break;
1582
    case  8:  strncpy(strbuf, "AC-3 (standard)", 32);        break;
1583
    case  9:  strncpy(strbuf, "AC-3 (dnet half-rate)", 32);  break;
1584
    case 10:  strncpy(strbuf, "AC-3 (dnet quater-rate", 32); break;
1582
    case  6:  av_strlcpy(strbuf, "AC-3 (alt syntax)", 32);      break;
1583
    case  8:  av_strlcpy(strbuf, "AC-3 (standard)", 32);        break;
1584
    case  9:  av_strlcpy(strbuf, "AC-3 (dnet half-rate)", 32);  break;
1585
    case 10:  av_strlcpy(strbuf, "AC-3 (dnet quater-rate", 32); break;
1585 1586
    default: snprintf(strbuf, 32, "ERROR");
1586 1587
    }
1587 1588
    av_dlog(avctx, "bitstream_id: %s (%d)\n", strbuf, s->bitstream_id);
......
1608 1609
    if (opt->audio_production_info) {
1609 1610
        av_dlog(avctx, "mixing_level: %ddB\n", opt->mixing_level);
1610 1611
        switch (opt->room_type) {
1611
        case 0:  strncpy(strbuf, "notindicated", 32); break;
1612
        case 1:  strncpy(strbuf, "large", 32);        break;
1613
        case 2:  strncpy(strbuf, "small", 32);        break;
1612
        case 0:  av_strlcpy(strbuf, "notindicated", 32); break;
1613
        case 1:  av_strlcpy(strbuf, "large", 32);        break;
1614
        case 2:  av_strlcpy(strbuf, "small", 32);        break;
1614 1615
        default: snprintf(strbuf, 32, "ERROR (%d)", opt->room_type);
1615 1616
        }
1616 1617
        av_dlog(avctx, "room_type: %s\n", strbuf);
......
1622 1623
    av_dlog(avctx, "dialnorm: %ddB\n", opt->dialogue_level);
1623 1624
    if (s->channel_mode == AC3_CHMODE_STEREO) {
1624 1625
        switch (opt->dolby_surround_mode) {
1625
        case 0:  strncpy(strbuf, "notindicated", 32); break;
1626
        case 1:  strncpy(strbuf, "on", 32);           break;
1627
        case 2:  strncpy(strbuf, "off", 32);          break;
1626
        case 0:  av_strlcpy(strbuf, "notindicated", 32); break;
1627
        case 1:  av_strlcpy(strbuf, "on", 32);           break;
1628
        case 2:  av_strlcpy(strbuf, "off", 32);          break;
1628 1629
        default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_mode);
1629 1630
        }
1630 1631
        av_dlog(avctx, "dsur_mode: %s\n", strbuf);
......
1636 1637
    if (s->bitstream_id == 6) {
1637 1638
        if (opt->extended_bsi_1) {
1638 1639
            switch (opt->preferred_stereo_downmix) {
1639
            case 0:  strncpy(strbuf, "notindicated", 32); break;
1640
            case 1:  strncpy(strbuf, "ltrt", 32);         break;
1641
            case 2:  strncpy(strbuf, "loro", 32);         break;
1640
            case 0:  av_strlcpy(strbuf, "notindicated", 32); break;
1641
            case 1:  av_strlcpy(strbuf, "ltrt", 32);         break;
1642
            case 2:  av_strlcpy(strbuf, "loro", 32);         break;
1642 1643
            default: snprintf(strbuf, 32, "ERROR (%d)", opt->preferred_stereo_downmix);
1643 1644
            }
1644 1645
            av_dlog(avctx, "dmix_mode: %s\n", strbuf);
......
1655 1656
        }
1656 1657
        if (opt->extended_bsi_2) {
1657 1658
            switch (opt->dolby_surround_ex_mode) {
1658
            case 0:  strncpy(strbuf, "notindicated", 32); break;
1659
            case 1:  strncpy(strbuf, "on", 32);           break;
1660
            case 2:  strncpy(strbuf, "off", 32);          break;
1659
            case 0:  av_strlcpy(strbuf, "notindicated", 32); break;
1660
            case 1:  av_strlcpy(strbuf, "on", 32);           break;
1661
            case 2:  av_strlcpy(strbuf, "off", 32);          break;
1661 1662
            default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_ex_mode);
1662 1663
            }
1663 1664
            av_dlog(avctx, "dsurex_mode: %s\n", strbuf);
1664 1665
            switch (opt->dolby_headphone_mode) {
1665
            case 0:  strncpy(strbuf, "notindicated", 32); break;
1666
            case 1:  strncpy(strbuf, "on", 32);           break;
1667
            case 2:  strncpy(strbuf, "off", 32);          break;
1666
            case 0:  av_strlcpy(strbuf, "notindicated", 32); break;
1667
            case 1:  av_strlcpy(strbuf, "on", 32);           break;
1668
            case 2:  av_strlcpy(strbuf, "off", 32);          break;
1668 1669
            default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_headphone_mode);
1669 1670
            }
1670 1671
            av_dlog(avctx, "dheadphone_mode: %s\n", strbuf);
1671 1672

  
1672 1673
            switch (opt->ad_converter_type) {
1673
            case 0:  strncpy(strbuf, "standard", 32); break;
1674
            case 1:  strncpy(strbuf, "hdcd", 32);     break;
1674
            case 0:  av_strlcpy(strbuf, "standard", 32); break;
1675
            case 1:  av_strlcpy(strbuf, "hdcd", 32);     break;
1675 1676
            default: snprintf(strbuf, 32, "ERROR (%d)", opt->ad_converter_type);
1676 1677
            }
1677 1678
            av_dlog(avctx, "ad_conv_type: %s\n", strbuf);

Also available in: Unified diff