[WINDOWS] Socket initialization issue and possible solution

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Milenko Offline
Junior Member
Posts: 8
Joined: Mar 2010
Reputation: 0
Post: #11
Works perfectly Laugh Thank you.

I saw there were some checkins concerning the format auto detection. Unfortunatly this still doesn't work well. Without the following code
Code:
bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput)
...
    else if( content.compare("video/x-mpeg2-ts") == 0 )
      iformat = m_dllAvFormat.av_find_input_format("mpegts");
the transport stream is still detected as mp3. Why not creating some kind of key/value XML document where all these content-type/demux mappings are present?

Also with the current SVN code, starting the playback takes a few seconds longer than before.
find quote
Milenko Offline
Junior Member
Posts: 8
Joined: Mar 2010
Reputation: 0
Post: #12
Milenko Wrote:Also with the current SVN code, starting the playback takes a few seconds longer than before.
hmmm, this was added on purpose with revision 29194 and 28813 to fix another issue...
find quote
Milenko Offline
Junior Member
Posts: 8
Joined: Mar 2010
Reputation: 0
Post: #13
It seems the problem is because there is not enough data buffered to figure out the type of the stream. The result of
Code:
pd.buf_size = m_dllAvFormat.get_partial_buffer(m_ioContext, pd.buf, m_ioContext->max_packet_size);
is very small. Sometimes 188 bytes (one TS packet) other times it is 376 bytes.
I changed the code to buffer at least max_packet_size bytes
Code:
if(m_ioContext->is_streamed)
      {
          while(true)
          {
                int nReaden = m_dllAvFormat.get_partial_buffer(m_ioContext, pd.buf+pd.buf_size, m_ioContext->max_packet_size-pd.buf_size);
                pd.buf_size += nReaden;
                if (m_ioContext->max_packet_size == pd.buf_size)
                    break;
          }
      }
      else
and now the auto detection seems to work fine.
find quote
Post Reply