libavformat/mpeg.c:505: error: Uninitialized Value
  The value read from dvdaudio_substream_type was never initialized.

libavformat/mpeg.c:505:9: 
503.         type = CODEC_TYPE_AUDIO;
504.         switch(dvdaudio_substream_type & 0xe0) {
505.         case 0xa0:  codec_id = CODEC_ID_PCM_DVD;
             ^
506.                     break;
507.         case 0x80:  if((dvdaudio_substream_type & 0xf8) == 0x88)

static int mpegps_read_packet(AVFormatContext *s,
                              AVPacket *pkt)
{
    MpegDemuxContext *m = s->priv_data;
    AVStream *st;
    int len, startcode, i, es_type;
    enum CodecID codec_id = CODEC_ID_NONE;
    enum CodecType type;
    int64_t pts, dts, dummy_pos;
    uint8_t dvdaudio_substream_type;
 redo:
    len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);
    if (len < 0)
        return len;
    if(startcode == 0x1bd) {
        dvdaudio_substream_type = get_byte(s->pb);
        url_fskip(s->pb, 3);
        len -= 4;
    }
    for(i=0;i<s->nb_streams;i++) {
        st = s->streams[i];
        if (st->id == startcode)
            goto found;
    }
    es_type = m->psm_es_type[startcode & 0xff];
    if(es_type > 0 && es_type != STREAM_TYPE_PRIVATE_DATA){
        if(es_type == STREAM_TYPE_VIDEO_MPEG1){
            codec_id = CODEC_ID_MPEG2VIDEO;
            type = CODEC_TYPE_VIDEO;
        } else if(es_type == STREAM_TYPE_VIDEO_MPEG2){
            codec_id = CODEC_ID_MPEG2VIDEO;
            type = CODEC_TYPE_VIDEO;
        } else if(es_type == STREAM_TYPE_AUDIO_MPEG1 ||
                  es_type == STREAM_TYPE_AUDIO_MPEG2){
            codec_id = CODEC_ID_MP3;
            type = CODEC_TYPE_AUDIO;
        } else if(es_type == STREAM_TYPE_AUDIO_AAC){
            codec_id = CODEC_ID_AAC;
            type = CODEC_TYPE_AUDIO;
        } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
            codec_id = CODEC_ID_MPEG4;
            type = CODEC_TYPE_VIDEO;
        } else if(es_type == STREAM_TYPE_VIDEO_H264){
            codec_id = CODEC_ID_H264;
            type = CODEC_TYPE_VIDEO;
        } else if(es_type == STREAM_TYPE_AUDIO_AC3){
            codec_id = CODEC_ID_AC3;
            type = CODEC_TYPE_AUDIO;
        } else {
            goto skip;
        }
    } else if (startcode >= 0x1e0 && startcode <= 0x1ef) {
        static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };
        unsigned char buf[8];
        get_buffer(s->pb, buf, 8);
        url_fseek(s->pb, -8, SEEK_CUR);
        if(!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
            codec_id = CODEC_ID_CAVS;
        else
            codec_id = CODEC_ID_PROBE;
        type = CODEC_TYPE_VIDEO;
    } else if (startcode >= 0x1c0 && startcode <= 0x1df) {
        type = CODEC_TYPE_AUDIO;
        codec_id = m->sofdec > 0 ? CODEC_ID_ADPCM_ADX : CODEC_ID_MP2;
    } else if (startcode >= 0x80 && startcode <= 0x87) {
        type = CODEC_TYPE_AUDIO;
        codec_id = CODEC_ID_AC3;
    } else if (  ( startcode >= 0x88 && startcode <= 0x8f)
               ||( startcode >= 0x98 && startcode <= 0x9f)) {
        type = CODEC_TYPE_AUDIO;
        codec_id = CODEC_ID_DTS;
    } else if (startcode >= 0xa0 && startcode <= 0xaf) {
        type = CODEC_TYPE_AUDIO;
        codec_id = CODEC_ID_PCM_DVD;
    } else if (startcode >= 0xb0 && startcode <= 0xbf) {
        type = CODEC_TYPE_AUDIO;
        codec_id = CODEC_ID_MLP;
    } else if (startcode >= 0xc0 && startcode <= 0xcf) {
        type = CODEC_TYPE_AUDIO;
        codec_id = CODEC_ID_AC3;
    } else if (startcode >= 0x20 && startcode <= 0x3f) {
        type = CODEC_TYPE_SUBTITLE;
        codec_id = CODEC_ID_DVD_SUBTITLE;
    } else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {
        type = CODEC_TYPE_VIDEO;
        codec_id = CODEC_ID_VC1;
    } else if (startcode == 0x1bd) {
        type = CODEC_TYPE_AUDIO;
        switch(dvdaudio_substream_type & 0xe0) {
        case 0xa0:  codec_id = CODEC_ID_PCM_DVD;
                    break;
        case 0x80:  if((dvdaudio_substream_type & 0xf8) == 0x88)
                         codec_id = CODEC_ID_DTS;
                    else codec_id = CODEC_ID_AC3;
                    break;
        default:    av_log(s, AV_LOG_ERROR, "Unknown 0x1bd sub-stream\n");
                    goto skip;
        }
    } else {
    skip:
        url_fskip(s->pb, len);
        goto redo;
    }
    st = av_new_stream(s, startcode);
    if (!st)
        goto skip;
    st->codec->codec_type = type;
    st->codec->codec_id = codec_id;
    if (codec_id != CODEC_ID_PCM_S16BE)
        st->need_parsing = AVSTREAM_PARSE_FULL;
 found:
    if(st->discard >= AVDISCARD_ALL)
        goto skip;
    if ((startcode >= 0xa0 && startcode <= 0xaf) ||
        (startcode == 0x1bd && ((dvdaudio_substream_type & 0xe0) == 0xa0))) {
        int b1, freq;
        if (len <= 3)
            goto skip;
        get_byte(s->pb);
        b1 = get_byte(s->pb);
        get_byte(s->pb);
        len -= 3;
        freq = (b1 >> 4) & 3;
        st->codec->sample_rate = lpcm_freq_tab[freq];
        st->codec->channels = 1 + (b1 & 7);
        st->codec->bits_per_coded_sample = 16 + ((b1 >> 6) & 3) * 4;
        st->codec->bit_rate = st->codec->channels *
                              st->codec->sample_rate *
                              st->codec->bits_per_coded_sample;
        if (st->codec->bits_per_coded_sample == 16)
            st->codec->codec_id = CODEC_ID_PCM_S16BE;
        else if (st->codec->bits_per_coded_sample == 28)
            return AVERROR(EINVAL);
    }
    av_new_packet(pkt, len);
    get_buffer(s->pb, pkt->data, pkt->size);
    pkt->pts = pts;
    pkt->dts = dts;
    pkt->stream_index = st->index;
#if 0
    av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
           pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);
#endif
    return 0;
}
['static int mpegps_read_packet(AVFormatContext *s,\n                              AVPacket *pkt)\n{\n    MpegDemuxContext *m = s->priv_data;\n    AVStream *st;\n    int len, startcode, i, es_type;\n    enum CodecID codec_id = CODEC_ID_NONE;\n    enum CodecType type;\n    int64_t pts, dts, dummy_pos;\n    uint8_t dvdaudio_substream_type;\n redo:\n    len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);\n    if (len < 0)\n        return len;\n    if(startcode == 0x1bd) {\n        dvdaudio_substream_type = get_byte(s->pb);\n        url_fskip(s->pb, 3);\n        len -= 4;\n    }\n    for(i=0;i<s->nb_streams;i++) {\n        st = s->streams[i];\n        if (st->id == startcode)\n            goto found;\n    }\n    es_type = m->psm_es_type[startcode & 0xff];\n    if(es_type > 0 && es_type != STREAM_TYPE_PRIVATE_DATA){\n        if(es_type == STREAM_TYPE_VIDEO_MPEG1){\n            codec_id = CODEC_ID_MPEG2VIDEO;\n            type = CODEC_TYPE_VIDEO;\n        } else if(es_type == STREAM_TYPE_VIDEO_MPEG2){\n            codec_id = CODEC_ID_MPEG2VIDEO;\n            type = CODEC_TYPE_VIDEO;\n        } else if(es_type == STREAM_TYPE_AUDIO_MPEG1 ||\n                  es_type == STREAM_TYPE_AUDIO_MPEG2){\n            codec_id = CODEC_ID_MP3;\n            type = CODEC_TYPE_AUDIO;\n        } else if(es_type == STREAM_TYPE_AUDIO_AAC){\n            codec_id = CODEC_ID_AAC;\n            type = CODEC_TYPE_AUDIO;\n        } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){\n            codec_id = CODEC_ID_MPEG4;\n            type = CODEC_TYPE_VIDEO;\n        } else if(es_type == STREAM_TYPE_VIDEO_H264){\n            codec_id = CODEC_ID_H264;\n            type = CODEC_TYPE_VIDEO;\n        } else if(es_type == STREAM_TYPE_AUDIO_AC3){\n            codec_id = CODEC_ID_AC3;\n            type = CODEC_TYPE_AUDIO;\n        } else {\n            goto skip;\n        }\n    } else if (startcode >= 0x1e0 && startcode <= 0x1ef) {\n        static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };\n        unsigned char buf[8];\n        get_buffer(s->pb, buf, 8);\n        url_fseek(s->pb, -8, SEEK_CUR);\n        if(!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))\n            codec_id = CODEC_ID_CAVS;\n        else\n            codec_id = CODEC_ID_PROBE;\n        type = CODEC_TYPE_VIDEO;\n    } else if (startcode >= 0x1c0 && startcode <= 0x1df) {\n        type = CODEC_TYPE_AUDIO;\n        codec_id = m->sofdec > 0 ? CODEC_ID_ADPCM_ADX : CODEC_ID_MP2;\n    } else if (startcode >= 0x80 && startcode <= 0x87) {\n        type = CODEC_TYPE_AUDIO;\n        codec_id = CODEC_ID_AC3;\n    } else if (  ( startcode >= 0x88 && startcode <= 0x8f)\n               ||( startcode >= 0x98 && startcode <= 0x9f)) {\n        type = CODEC_TYPE_AUDIO;\n        codec_id = CODEC_ID_DTS;\n    } else if (startcode >= 0xa0 && startcode <= 0xaf) {\n        type = CODEC_TYPE_AUDIO;\n        codec_id = CODEC_ID_PCM_DVD;\n    } else if (startcode >= 0xb0 && startcode <= 0xbf) {\n        type = CODEC_TYPE_AUDIO;\n        codec_id = CODEC_ID_MLP;\n    } else if (startcode >= 0xc0 && startcode <= 0xcf) {\n        type = CODEC_TYPE_AUDIO;\n        codec_id = CODEC_ID_AC3;\n    } else if (startcode >= 0x20 && startcode <= 0x3f) {\n        type = CODEC_TYPE_SUBTITLE;\n        codec_id = CODEC_ID_DVD_SUBTITLE;\n    } else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {\n        type = CODEC_TYPE_VIDEO;\n        codec_id = CODEC_ID_VC1;\n    } else if (startcode == 0x1bd) {\n        type = CODEC_TYPE_AUDIO;\n        switch(dvdaudio_substream_type & 0xe0) {\n        case 0xa0:  codec_id = CODEC_ID_PCM_DVD;\n                    break;\n        case 0x80:  if((dvdaudio_substream_type & 0xf8) == 0x88)\n                         codec_id = CODEC_ID_DTS;\n                    else codec_id = CODEC_ID_AC3;\n                    break;\n        default:    av_log(s, AV_LOG_ERROR, "Unknown 0x1bd sub-stream\\n");\n                    goto skip;\n        }\n    } else {\n    skip:\n        url_fskip(s->pb, len);\n        goto redo;\n    }\n    st = av_new_stream(s, startcode);\n    if (!st)\n        goto skip;\n    st->codec->codec_type = type;\n    st->codec->codec_id = codec_id;\n    if (codec_id != CODEC_ID_PCM_S16BE)\n        st->need_parsing = AVSTREAM_PARSE_FULL;\n found:\n    if(st->discard >= AVDISCARD_ALL)\n        goto skip;\n    if ((startcode >= 0xa0 && startcode <= 0xaf) ||\n        (startcode == 0x1bd && ((dvdaudio_substream_type & 0xe0) == 0xa0))) {\n        int b1, freq;\n        if (len <= 3)\n            goto skip;\n        get_byte(s->pb);\n        b1 = get_byte(s->pb);\n        get_byte(s->pb);\n        len -= 3;\n        freq = (b1 >> 4) & 3;\n        st->codec->sample_rate = lpcm_freq_tab[freq];\n        st->codec->channels = 1 + (b1 & 7);\n        st->codec->bits_per_coded_sample = 16 + ((b1 >> 6) & 3) * 4;\n        st->codec->bit_rate = st->codec->channels *\n                              st->codec->sample_rate *\n                              st->codec->bits_per_coded_sample;\n        if (st->codec->bits_per_coded_sample == 16)\n            st->codec->codec_id = CODEC_ID_PCM_S16BE;\n        else if (st->codec->bits_per_coded_sample == 28)\n            return AVERROR(EINVAL);\n    }\n    av_new_packet(pkt, len);\n    get_buffer(s->pb, pkt->data, pkt->size);\n    pkt->pts = pts;\n    pkt->dts = dts;\n    pkt->stream_index = st->index;\n#if 0\n    av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\\n",\n           pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);\n#endif\n    return 0;\n}']