OLD | NEW |
1 /* | 1 /* |
2 * Musepack demuxer | 2 * Musepack demuxer |
3 * Copyright (c) 2006 Konstantin Shishkov | 3 * Copyright (c) 2006 Konstantin Shishkov |
4 * | 4 * |
5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
6 * | 6 * |
7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 av_add_index_entry(s->streams[0], cur, cur, size, 0, AVINDEX_KEYFRAME); | 163 av_add_index_entry(s->streams[0], cur, cur, size, 0, AVINDEX_KEYFRAME); |
164 c->frames_noted++; | 164 c->frames_noted++; |
165 } | 165 } |
166 c->curbits = (curbits + size2) & 0x1F; | 166 c->curbits = (curbits + size2) & 0x1F; |
167 | 167 |
168 if (av_new_packet(pkt, size) < 0) | 168 if (av_new_packet(pkt, size) < 0) |
169 return AVERROR(EIO); | 169 return AVERROR(EIO); |
170 | 170 |
171 pkt->data[0] = curbits; | 171 pkt->data[0] = curbits; |
172 pkt->data[1] = (c->curframe > c->fcount); | 172 pkt->data[1] = (c->curframe > c->fcount); |
| 173 pkt->data[2] = 0; |
| 174 pkt->data[3] = 0; |
173 | 175 |
174 pkt->stream_index = 0; | 176 pkt->stream_index = 0; |
175 pkt->pts = cur; | 177 pkt->pts = cur; |
176 ret = get_buffer(s->pb, pkt->data + 4, size); | 178 ret = get_buffer(s->pb, pkt->data + 4, size); |
177 if(c->curbits) | 179 if(c->curbits) |
178 url_fseek(s->pb, -4, SEEK_CUR); | 180 url_fseek(s->pb, -4, SEEK_CUR); |
179 if(ret < size){ | 181 if(ret < size){ |
180 av_free_packet(pkt); | 182 av_free_packet(pkt); |
181 return AVERROR(EIO); | 183 return AVERROR(EIO); |
182 } | 184 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 "mpc", | 240 "mpc", |
239 NULL_IF_CONFIG_SMALL("Musepack"), | 241 NULL_IF_CONFIG_SMALL("Musepack"), |
240 sizeof(MPCContext), | 242 sizeof(MPCContext), |
241 mpc_probe, | 243 mpc_probe, |
242 mpc_read_header, | 244 mpc_read_header, |
243 mpc_read_packet, | 245 mpc_read_packet, |
244 mpc_read_close, | 246 mpc_read_close, |
245 mpc_read_seek, | 247 mpc_read_seek, |
246 .extensions = "mpc", | 248 .extensions = "mpc", |
247 }; | 249 }; |
OLD | NEW |