Repository: xbmc/xbmc
File: xbmc/cores/VideoPlayer/VideoPlayer.cpp (C++)

Code before:
                       { return stream->type == STREAM_AUDIO && stream->dvdNavId == i; });
      CDemuxStreamAudio* aStream =
          (stream != demuxStreams.end()) ? static_cast<CDemuxStreamAudio*>(*stream) : nullptr;

      SelectionStream s;
      s.source   = source;
      s.type     = STREAM_AUDIO;
      s.id       = i;
      s.flags    = StreamFlags::FLAG_NONE;
      s.filename = filename;

      AudioStreamInfo info = nav->GetAudioStreamInfo(i);
      s.name     = info.name;
      s.codec    = info.codecName;
      if (aStream)
      {
        s.codecDesc = aStream->GetStreamType();
        s.channels = aStream->iChannels;
        s.bitrate = aStream->iBitRate;
      }
      else
      {
        s.codecDesc = info.codecDesc;
        s.channels = info.channels;
      }
      s.language = g_LangCodeExpander.ConvertToISO6392B(info.language);
      s.flags = info.flags;
      Update(s);
    }

    count = nav->GetSubTitleStreamCount();
    for(int i=0;i<count;i++)
    {
      SelectionStream s;
      s.source   = source;
      s.type     = STREAM_SUBTITLE;
      s.id       = i;
      s.filename = filename;
      s.channels = 0;

      SubtitleStreamInfo info = nav->GetSubtitleStreamInfo(i);
      s.name     = info.name;
      s.codec = info.codecName;
      s.flags = info.flags;
      s.language = g_LangCodeExpander.ConvertToISO6392B(info.language);
      Update(s);
    }

    VideoStreamInfo info = nav->GetVideoStreamInfo();
    for (int i = 1; i <= info.angles; i++)
    {

Review comment (suggestion):
if you want keep this mixage you have to explain the reason because to me its unclear,
im running the original code without your "aStream" condition and i can get the codecDesc/channels correctly also on menu interludes

an idea is to have these metadata info provided by nav, and a possible fallback from ffmpeg (aStream)

Code after:
                       { return stream->type == STREAM_AUDIO && stream->dvdNavId == i; });
      CDemuxStreamAudio* aStream =
          (stream != demuxStreams.end()) ? static_cast<CDemuxStreamAudio*>(*stream) : nullptr;

      SelectionStream s;
      s.source   = source;
      s.type     = STREAM_AUDIO;
      s.id       = i;
      s.flags    = StreamFlags::FLAG_NONE;
      s.filename = filename;

      AudioStreamInfo info = nav->GetAudioStreamInfo(i);
      s.name     = info.name;
      s.codec    = info.codecName;
      // additional/more reliable info from ffmpeg than IFO nav data
      if (aStream)
      {
        s.codecDesc = aStream->GetStreamType();
        s.channels = aStream->iChannels;
        s.bitrate = aStream->iBitRate;
      }
      else
      {
        s.codecDesc = info.codecDesc;
        s.channels = info.channels;
      }
      s.language = g_LangCodeExpander.ConvertToISO6392B(info.language);
      s.flags = info.flags;
      Update(s);
    }

    count = nav->GetSubTitleStreamCount();
    for(int i=0;i<count;i++)
    {
      SelectionStream s;
      s.source   = source;
      s.type     = STREAM_SUBTITLE;
      s.id       = i;
      s.filename = filename;
      s.channels = 0;

      SubtitleStreamInfo info = nav->GetSubtitleStreamInfo(i);
      s.name     = info.name;
      s.codec = info.codecName;
      s.flags = info.flags;
      s.language = g_LangCodeExpander.ConvertToISO6392B(info.language);
      Update(s);
    }

    VideoStreamInfo info = nav->GetVideoStreamInfo();
    for (int i = 1; i <= info.angles; i++)