| | |
| | | } |
| | | |
| | | ret = avformat_open_input(&ctx_, "", NULL, options); |
| | | if(ret < 0){ |
| | | logIt("open %s failed:%s",filename, |
| | | getAVErrorDesc(ret).c_str()); |
| | | |
| | | } |
| | | // if(ret < 0){ |
| | | // logIt("open %s failed:%s",filename, |
| | | // getAVErrorDesc(ret).c_str()); |
| | | // } |
| | | |
| | | return ret; |
| | | } |
| | |
| | | int FormatIn::open(const char *filename, AVDictionary **options){ |
| | | |
| | | const int ret = avformat_open_input(&ctx_, filename, NULL, options); |
| | | if(ret < 0){ |
| | | logIt("open %s failed:%s",filename, |
| | | getAVErrorDesc(ret).c_str()); |
| | | |
| | | } |
| | | // if(ret < 0){ |
| | | // logIt("open %s failed:%s",filename, |
| | | // getAVErrorDesc(ret).c_str()); |
| | | // } |
| | | |
| | | return ret; |
| | | } |
| | |
| | | while (!founded){ |
| | | const int ret = av_read_frame(ctx_, &pkt_out); |
| | | if(ret < 0){ |
| | | logIt("read frame from %s failed:%s", |
| | | ctx_->filename,getAVErrorDesc(ret).c_str()); |
| | | // logIt("read frame from %s failed:%s", |
| | | // ctx_->filename,getAVErrorDesc(ret).c_str()); |
| | | |
| | | return false; |
| | | } |