- s->format = bd_audio_format(st->codec->channels);
- s->rate = bd_audio_rate(st->codec->sample_rate);
- strcpy((char*)s->lang, "und");
+ s->format = bd_audio_format(st->codecpar->channels);
+ s->rate = bd_audio_rate(st->codecpar->sample_rate);
+ strcpy((char*)s->lang, "eng");
+ break; }
+ case AVMEDIA_TYPE_SUBTITLE: {
+ s->coding_type = bd_stream_type(codec_id);
+ AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", 0, 0);
+ strncpy((char*)s->lang, lang ? lang->value : "und", sizeof(s->lang));