diff options
Diffstat (limited to 'libmpdemux/demux_aac.c')
-rw-r--r-- | libmpdemux/demux_aac.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libmpdemux/demux_aac.c b/libmpdemux/demux_aac.c index ee9f1e935e..2ebbb2995e 100644 --- a/libmpdemux/demux_aac.c +++ b/libmpdemux/demux_aac.c @@ -48,11 +48,11 @@ int aac_parse_frame(uint8_t *buf, int *srate, int *num); static int demux_aac_init(demuxer_t *demuxer) { aac_priv_t *priv; - + priv = calloc(1, sizeof(aac_priv_t)); if(!priv) return 0; - + priv->buf = (uint8_t*) malloc(8); if(!priv->buf) { @@ -67,7 +67,7 @@ static int demux_aac_init(demuxer_t *demuxer) static void demux_close_aac(demuxer_t *demuxer) { aac_priv_t *priv = (aac_priv_t *) demuxer->priv; - + if(!priv) return; @@ -85,13 +85,13 @@ static int demux_aac_probe(demuxer_t *demuxer) int cnt = 0, c, len, srate, num; off_t init, probed; aac_priv_t *priv; - + if(! demux_aac_init(demuxer)) { mp_msg(MSGT_DEMUX, MSGL_ERR, "COULDN'T INIT aac_demux, exit\n"); return 0; } - + priv = (aac_priv_t *) demuxer->priv; init = probed = stream_tell(demuxer->stream); @@ -107,7 +107,7 @@ static int demux_aac_probe(demuxer_t *demuxer) priv->buf[0] = 0xFF; if(stream_read(demuxer->stream, &(priv->buf[1]), 7) < 7) goto fail; - + len = aac_parse_frame(priv->buf, &srate, &num); if(len > 0) { @@ -120,7 +120,7 @@ static int demux_aac_probe(demuxer_t *demuxer) stream_seek(demuxer->stream, init); if(cnt < 8) goto fail; - + mp_msg(MSGT_DEMUX, MSGL_V, "demux_aac_probe, INIT: %"PRIu64", PROBED: %"PRIu64", cnt: %d\n", init, probed, cnt); return DEMUXER_TYPE_AAC; @@ -140,7 +140,7 @@ static demuxer_t* demux_aac_open(demuxer_t *demuxer) demuxer->audio->sh = sh; demuxer->filepos = stream_tell(demuxer->stream); - + return demuxer; } @@ -173,7 +173,7 @@ static int demux_aac_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) priv->buf[1] = (unsigned char) c2; if(stream_read(demuxer->stream, &(priv->buf[2]), 6) < 6) return 0; - + len = aac_parse_frame(priv->buf, &srate, &num); if(len > 0) { @@ -183,8 +183,8 @@ static int demux_aac_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) mp_msg(MSGT_DEMUX, MSGL_ERR, "fill_buffer, NEW_ADD_PACKET(%d)FAILED\n", len); return 0; } - - + + memcpy(dp->buffer, priv->buf, 8); stream_read(demuxer->stream, &(dp->buffer[8]), len-8); if(srate) @@ -195,10 +195,10 @@ static int demux_aac_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) ds_add_packet(demuxer->audio, dp); priv->size += len; priv->time += tm; - + priv->bitrate = (int) (priv->size / priv->time); demuxer->filepos = stream_tell(demuxer->stream); - + return len; } else @@ -220,7 +220,7 @@ static void demux_aac_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_ ds_free_packs(d_audio); time = (flags & SEEK_ABSOLUTE) ? rel_seek_secs - priv->last_pts : rel_seek_secs; - if(time < 0) + if(time < 0) { stream_seek(demuxer->stream, demuxer->movi_start); time = priv->last_pts + time; @@ -232,13 +232,13 @@ static void demux_aac_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_ int len, nf, srate, num; nf = time * sh_audio->samplerate/1024; - - while(nf > 0) + + while(nf > 0) { if(stream_read(demuxer->stream,priv->buf, 8) < 8) break; len = aac_parse_frame(priv->buf, &srate, &num); - if(len <= 0) + if(len <= 0) { stream_skip(demuxer->stream, -7); continue; |