[Libav-user] av_probe_input_buffer

Andy Huang andy.y.huang at gmail.com
Thu May 30 18:46:06 CEST 2013


Hi, I am trying to create an app on android that can play MPEG stream. So I
have following code:

AVFormatContext*    LibavDecoder::openInput               ()

{

    AVFormatContext *avFormatContextPtr = NULL;

    int             err                 = 0;


    this->iobuffer                      = (unsigned char*)
av_malloc(bufferSize);

    avFormatContextPtr                  = avformat_alloc_context();

    avFormatContextPtr->pb              = avio_alloc_context(this->iobuffer,
bufferSize, 0, receiver, IORead, NULL, NULL);

    avFormatContextPtr->pb->seekable    = 0;

    err = avformat_open_input(&avFormatContextPtr, "", NULL, NULL);

    if (err != 0)

    {

        error("Error while calling avformat_open_input", err);

    } else

    {

        err = avformat_find_stream_info(avFormatContextPtr, 0);

        if (err < 0)

            error("Error while calling avformat_find_stream_info", err);

    }

    return avFormatContextPtr;

}


But for some reason, the call "avformat_open_input" doesn't return. So I
put logging into the libavformat and found out that, in the "utils.c",
function "av_probe_input_buffer" called by "init_input", which is called by
"avformat_open_input", doesn't return.

The same code works fine on iOS, but not on Android 2.3.3 and above. Any
help will be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130530/4c299da6/attachment.html>


More information about the Libav-user mailing list