<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Right Stationery</TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16434"></HEAD>
<BODY
style="BACKGROUND-COLOR: #e0e0e0; FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE: 10pt"
background="" bgColor=#e0e0e0>
<DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080 size=3 face="Trebuchet MS"><SPAN
class=590564313-22092011>Hi,</SPAN></FONT></SPAN></DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080 size=3 face="Trebuchet MS"><SPAN
class=590564313-22092011></SPAN></FONT></SPAN></DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080><SPAN class=590564313-22092011><FONT
face="Trebuchet MS"><FONT size=3>I am experiencing problems with using
av_guess_format / avformat_alloc_context. In my sample code below, my
application crashes on "<FONT color=#000000><SPAN
class=590564313-22092011>m_Out</SPAN>fmt = av_guess_format (
"mp3"</FONT></FONT></FONT><FONT color=#000000><FONT size=3 face="Trebuchet MS">,
NULL, NULL);"<SPAN class=420050914-22092011> with the message "Unhandled
exception at 0x773b2865 in test.exe: 0xC0000008: An invalid handle was
specified."</SPAN> .</FONT></FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080><SPAN class=590564313-22092011><FONT
color=#000000><FONT size=3
face="Trebuchet MS"></FONT></FONT></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080><SPAN class=590564313-22092011><FONT
color=#000000><FONT size=3 face="Trebuchet MS"> The AVOuptputFormat struct
seems to contain garbage after this call, e.g. audio_codec = -1163005939.</FONT>
</FONT><FONT color=#005080 size=3 face="Trebuchet MS"><SPAN
class=590564313-22092011>The odd thing is that even though m_OutFmt contains
what appears to me to be garbage, the break occurs only on <FONT
color=#000000>"<SPAN class=590564313-22092011>m</SPAN>_<SPAN
class=590564313-22092011>O</SPAN>ut<SPAN
class=590564313-22092011>F</SPAN>mt<SPAN class=590564313-22092011>C</SPAN>ontext
= avformat_alloc_context ();". At this point the breakpoint jumps back to <FONT
color=#005080>"</FONT><SPAN class=590564313-22092011><FONT
color=#000000>m_Out</SPAN>fmt = av_guess_format ( encoding<SPAN
class=590564313-22092011><FONT color=#005080>S</SPAN></FONT></FONT><FONT
color=#000000><FONT size=3 face="Trebuchet MS">tr, NULL, NULL);"
</FONT></FONT></FONT></SPAN></FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080><SPAN class=590564313-22092011><FONT
color=#000000 size=3 face="Trebuchet MS"><SPAN
class=590564313-22092011></SPAN></FONT></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN lang=EN-ZA><FONT color=#005080><SPAN class=590564313-22092011><FONT
color=#000000 size=3 face="Trebuchet MS"><SPAN class=590564313-22092011><SPAN
class=420050914-22092011>I am using VS2008 with Windows 7 and libavutil 51.
16. 1, libavcodec 53. 16. 0 and libavformat 53. 12.
0.</SPAN></SPAN></FONT></DIV>
<P><FONT color=#000000 size=3 face="Trebuchet MS"><SPAN
class=590564313-22092011>Any assistance will be much
appreciated.</SPAN></FONT></P>
<P></SPAN></FONT></SPAN><SPAN class=590564313-22092011>m_Out</SPAN>fmt =
av_guess_format ( <SPAN class=590564313-22092011>"mp3"</SPAN>, NULL, NULL);</P>
<DIV>
<P><FONT color=#0000ff><FONT color=#0000ff>if</FONT></FONT>( !<SPAN
class=590564313-22092011>m</SPAN>_Outfmt )</P>
<P><FONT color=#0000ff><SPAN class=590564313-22092011></SPAN>return</FONT> <FONT
color=#0000ff><FONT color=#0000ff>false</FONT></FONT>;</P>
<P><SPAN class=590564313-22092011>m</SPAN>_<SPAN
class=590564313-22092011>O</SPAN>ut<SPAN
class=590564313-22092011>F</SPAN>mt<SPAN class=590564313-22092011>C</SPAN>ontext
= avformat_alloc_context ();</P></DIV></DIV></BODY></HTML>