summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_mpg123.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-14 17:59:26 +0200
committerwm4 <wm4@nowhere>2013-07-14 17:59:26 +0200
commite18ffd6b998858ca0797cb0ce4aabd4a509655dd (patch)
tree199bddd30923db1175a1331191eb86ba684e9e41 /audio/decode/ad_mpg123.c
parent3e7d483ac89289f613138002be2043ec5f479bb0 (diff)
parent5ead20bdb3328d199dad693039d18e7a05eb2465 (diff)
downloadmpv-e18ffd6b998858ca0797cb0ce4aabd4a509655dd.tar.bz2
mpv-e18ffd6b998858ca0797cb0ce4aabd4a509655dd.tar.xz
Merge branch 'remove_old_demuxers'
The merged branch doesn't actually just remove old demuxers, but also includes a branch of cleanups and some refactoring. Conflicts: stream/stream.c
Diffstat (limited to 'audio/decode/ad_mpg123.c')
-rw-r--r--audio/decode/ad_mpg123.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/audio/decode/ad_mpg123.c b/audio/decode/ad_mpg123.c
index 08739b7f4b..8d97468e06 100644
--- a/audio/decode/ad_mpg123.c
+++ b/audio/decode/ad_mpg123.c
@@ -217,27 +217,25 @@ static int decode_a_bit(sh_audio_t *sh, unsigned char *buf, int count)
/* Feed the decoder. This will only fire from the second round on. */
if (ret == MPG123_NEED_MORE) {
- int incount;
- double pts;
- unsigned char *inbuf;
/* Feed more input data. */
- incount = ds_get_packet_pts(sh->ds, &inbuf, &pts);
- if (incount <= 0)
+ struct demux_packet *pkt = demux_read_packet(sh->gsh);
+ if (!pkt)
break; /* Apparently that's it. EOF. */
/* Next bytes from that presentation time. */
- if (pts != MP_NOPTS_VALUE) {
- sh->pts = pts;
+ if (pkt->pts != MP_NOPTS_VALUE) {
+ sh->pts = pkt->pts;
sh->pts_bytes = 0;
}
#ifdef AD_MPG123_FRAMEWISE
/* Have to use mpg123_feed() to avoid decoding here. */
- ret = mpg123_feed(con->handle, inbuf, incount);
+ ret = mpg123_feed(con->handle, pkt->buffer, pkt->len);
#else
/* Do not use mpg123_feed(), added in later libmpg123 versions. */
- ret = mpg123_decode(con->handle, inbuf, incount, NULL, 0, NULL);
+ ret = mpg123_decode(con->handle, pkt->buffer, pkt->len, NULL, 0, NULL);
#endif
+ talloc_free(pkt);
if (ret == MPG123_ERR)
break;
}