<div dir="ltr">I tried playing another mp3 file then at the below line.<p class="">int res = av_find_stream_info<span class="">(pFormatCtx);</span></p><p class="">I got res as -1 so this is unable to find stream info..so please help in solving this issue..</p>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 31, 2013 at 6:21 PM, Robert Schmidt <span dir="ltr"><<a href="mailto:rob.f.schmidt86@gmail.com" target="_blank">rob.f.schmidt86@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Oct 31, 2013 at 9:46 AM, Yamusani Vinay <<a href="mailto:yamusanivinay@gmail.com">yamusanivinay@gmail.com</a>> wrote:<br>

><br>
> the error is while decoding the length obtained  is negative.<br>
><br>
<br>
</div>One possibility is that you might be trying to decode a non-audio<br>
packet.  On line 110, after you've read a packet from the file, you<br>
check if your decoding context is for audio, which will always be<br>
true.  What I think you want to do is instead check that the packet<br>
you retrieved is associated with your audio stream and not some other<br>
stream in the file.<br>
<br>
Something like<br>
<br>
    if (packet.stream_index == audioStream)<br>
<br>
It's possible this code worked for a .wav file if the file only had a<br>
single stream containing audio data.<br>
<br>
Hope this helps.<br>
<br>
Rob<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div>