Ticket #465: mp3br_update.diff

File mp3br_update.diff, 780 bytes (added by reimar, 20 years ago)

Possible, though maybe ugly fix

  • libmpdemux/demux_audio.c

     
    577577  case MP3 :
    578578    while(1) {
    579579      uint8_t hdr[4];
     580      int br;
    580581      stream_read(s,hdr,4);
    581582      if (s->eof)
    582583        return 0;
    583       l = mp_decode_mp3_header(hdr);
     584      l = mp_get_mp3_header(hdr, NULL, NULL, NULL, NULL, &br);
    584585      if(l < 0) {
    585586        if (demux->movi_end && stream_tell(s) >= demux->movi_end)
    586587          return 0; // might be ID3 tag, i.e. EOF
     
    594595          return 0;
    595596        }
    596597        priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + sh_audio->audio.dwScale/(float)sh_audio->samplerate;
     598        sh_audio->i_bps = br;
    597599        break;
    598600      }
    599601    } break;