Sorry to send this again, but I really need to find a way to do this... Please see my forwarded e-mail...
Thanks in advance... Tom ---------- Forwarded message ---------- From: Tom Handal <[email protected]> Date: Fri, Mar 13, 2009 at 11:15 AM Subject: [libav-user] av_open_input_stream not getting duration To: [email protected] Hi all, I am trying to use av_open_input_stream to open the stream, which works great. The problem I am having is that the duration entry in the format context is not getting set to a proper value. This is on Mac OS X (Leopard). What am I doing wrong here? code: AVProbeData pd; av_register_all(); pd.filename = m_URI; // This is just a regular local filename pd.buf = (unsigned char *) av_malloc(188 * 50); pd.buf_size = 188 * 50; m_pByteDataPtr = pd.buf; m_pFormatContext = NULL; // Read small amount of data to determine format m_pFileReader->Read((char *) pd.buf, pd.buf_size); init_put_byte(&m_ByteIOContext, m_pByteDataPtr, pd.buf_size, 0, this, ReadData, NULL, SeekFile); // ReadData and SeekFile are functions that just use my FileReader class to read and seek into file ... this is standard posix stuff m_pInputFormat = av_probe_input_format(&pd, 1); m_ByteIOContext.is_streamed = 0; av_open_input_stream(&m_pFormatContext, &m_ByteIOContext, m_URI, m_pInputFormat, NULL); av_find_stream_info(m_pFormatContext); dump_format(m_pFormatContext, 0, "", false); When the dump format happens, it says that the duration is N/A, so I am assuming it is AV_NOPTS_VALUE or whatever... When i look at the m_pFormatContext in the debugger, the value is obiously wrong... its like -9223372036854775808 Any ideas as to why it is not getting the duration of the file for me? Thanks in advance!! Tom _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
