Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    【FAQ】全志R329如何解决在线mp3流媒体seek异常?

    其它全志芯片讨论区
    r329 r328 r818 faq 技术支持
    1
    1
    1290
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • q1215200171
      budbool LV 9 last edited by

      现象

      tplayerdemo播放任意在线mp3 http/https流,刚开始播放约几秒后,执行命令 seek to: 100 ,会从0开始播放。

      注意:出现以上问题的码流为包含ID3V2.3标签的mp3流,且仅在网络播放时才会复现该问题。该类问题码流可通过工具HxD查看识别,如下图所示:

      399d34c948c64dd2863ff9e0b79c45f1.jfif

      红框是在文件的首部顺序记录的10个字节的ID3V2.4的头部。数据结构如下:

      char Header[3];     //必须为"ID3"否则认为标签不存在
        char Ver;       //版本号 ID3V2.4就记录4
        char Revision;     //副版本号 此版本记录为0
        char Flag;       //存放标志的字节,这个版本只定义了三位
        char Size[4];      //标签大小,包括标签头的10 个字节和所有的标签帧的大小
      

      具有以上类似标签的为问题码流,可复现以上seek失败的问题。

      问题码流

      https://openfreetystvip.migu.cn/public/product9th/product42/2020/10/0117/2020年10月01日14点12分紧急内容准入咪咕音乐自有版权4222首/标清高清/MP3_128_16_Stero/69905304100175532.mp3?channelid=08&msisdn=c9ae4994-20fb-4019-a62f-462bf83f4841&k=0112e08c04770255&t=1603096249914

      问题分析

      因为客户提供的MP3文件包含ID3V2部分,该ID3 tag信息位于文件开头,所以文件播放时会有一个 baseOffset 偏移。在执行seek时,由于 baseOffset 的偏移值非0,导致控制流函数进入了错误的else分支,startPos未能正确的设置给函数 CdxHttpSetField(httpHdr, str) ,而是错误的将baseOffset设置给函数 CdxHttpSetField(httpHdr, str) ,导致每次seek都会从头开始播放。

      解决方法

      添加限制条件,将原来的 if(pos == 0) 改为 if(pos == 0 || pos < d->startPos),使开始播放的位置正确,即设置正确的Range值。

      (patch见附件,基于tina-v3.5)
      0001-libcedarx-Solve-seek-abnormal-problem-of-online-MP3-.patch

      1 Reply Last reply Reply Quote Share 0
      • Referenced by  q1215200171 q1215200171 
      • Referenced by  q1215200171 q1215200171 
      • Referenced by  q1215200171 q1215200171 
      • Referenced by  q1215200171 q1215200171 
      • Referenced by  q1215200171 q1215200171 
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策