avformat_find_stream_info 崩溃

13 篇文章 0 订阅
ffmepg 解码的一般流程如下:
 
av_register_all();
avformat_network_init();


url = "http://ltsbsy.qq.com/GB8lF6TL4NgUddNDzdolIN4HvPZ8zz5daxlsXsx5-6cZSDGZ6BCCX3rCl-gReh6iEaTVGJs0ZmqZVbOCYENLACEvBl-LtHkj-r6V9gAo4IcLvTrdg_yHcA/r0023flooix.320092.ts.m3u8?ver=4&sdtfrom=v4000&platform=10103&appver=5.0.2.4720";
//这个链接过一会儿就失效了


m_pFormatCtx = avformat_alloc_context();
AVDictionary *dic2 = NULL;
AVInputFormat *m_pInFmt = NULL;
 int ret2 = avformat_open_input(&m_pFormatCtx, url.toLocal8Bit(), m_pInFmt, &dic2);
 AVDictionary *dic3 = NULL;
 ret3 = avformat_find_stream_info(m_pFormatCtx, &dic3);//这里寻找流的信息,会卡个1s左右,因为它在寻找流的信息




 然后 avformat_find_stream_info 就崩溃了


为什么呢?
后来在以为大神的指导下,改为了 
avformat_find_stream_info(m_pFormatCtx, NULL);
就OK了
以前以为传入一个指向NULL的指针,和 NULL一样,现在看来是不一样的
具体的解释,看这个函数的文档就知道了
 * @param options  If non-NULL, an ic.nb_streams long array of pointers to
 *                 dictionaries, where i-th member contains options for
 *                 codec corresponding to i-th stream.
 *                 On return each dictionary will be filled with options that were not found.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
06-01 15:46:59.758 4646 4646 F DEBUG : Revision: '0' 06-01 15:46:59.758 4646 4646 F DEBUG : ABI: 'arm' 06-01 15:46:59.758 4646 4646 F DEBUG : pid: 4642, tid: 4642, name: mytest >>> ./mytest <<< 06-01 15:46:59.758 4646 4646 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 06-01 15:46:59.758 4646 4646 F DEBUG : Cause: null pointer dereference 06-01 15:46:59.758 4646 4646 F DEBUG : r0 92fb5000 r1 9de3d7dc r2 9de3d7d8 r3 9de3d7e8 06-01 15:46:59.759 4646 4646 F DEBUG : r4 05080bd1 r5 9450680c r6 00000002 r7 00000000 06-01 15:46:59.759 4646 4646 F DEBUG : r8 00000000 r9 00000000 r10 00000000 r11 92fb5000 06-01 15:46:59.759 4646 4646 F DEBUG : ip ffffffda sp 9de3d718 lr 944d89b1 pc 00000000 06-01 15:46:59.775 4646 4646 F DEBUG : 06-01 15:46:59.775 4646 4646 F DEBUG : backtrace: 06-01 15:46:59.775 4646 4646 F DEBUG : #00 pc 00000000 <unknown> 06-01 15:46:59.775 4646 4646 F DEBUG : #01 pc 000e09af /system/lib/libavformat.so (avformat_find_stream_info+158) 06-01 15:46:59.775 4646 4646 F DEBUG : #02 pc 00000c0d /data/mytest (main+60) 06-01 15:46:59.775 4646 4646 F DEBUG : #03 pc 0008be09 /system/lib/libc.so (__libc_init+48) 06-01 15:46:59.775 4646 4646 F DEBUG : #04 pc 00000b8f /data/mytest (_start_main+46) 06-01 15:46:59.776 4646 4646 F DEBUG : #05 pc 00019ac7 /system/bin/linker (__dl__ZNSt3__112__hash_tableINS_17__hash_value_typeIjP6soinfoEENS_22__unordered_map_hasherIjS4_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS4_NS_8equal_toIjEELb1EEENS_9allocatorIS4_EEE14__erase_uniqueIjEEjRKT_+90) 06-01 15:46:59.776 4646 4646 F DEBUG : #06 pc 00020e8d [stack:9de1d000]
06-02
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值