* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#include "libavcodec/bitstream.h"
#include "avformat.h"
#include "mpegts.h"
-#include "bitstream.h"
#include <unistd.h>
#include "network.h"
if (infos == NULL)
return -1;
- /* decode the first 2 bytes where are stored the AUHeader sections
+ /* decode the first 2 bytes where the AUHeader sections are stored
length in bits */
au_headers_length = AV_RB16(buf);
const uint8_t *buf, int len)
{
unsigned int ssrc, h;
- int payload_type, seq, ret;
+ int payload_type, seq, ret, flags = 0;
AVStream *st;
uint32_t timestamp;
int rv= 0;
/* return the next packets, if any */
if(s->st && s->parse_packet) {
timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned....
- rv= s->parse_packet(s, pkt, ×tamp, NULL, 0);
+ rv= s->parse_packet(s, pkt, ×tamp, NULL, 0, flags);
finalize_packet(s, pkt, timestamp);
return rv;
} else {
s->read_buf_index = 0;
return 1;
}
+ } else if (s->parse_packet) {
+ rv = s->parse_packet(s, pkt, ×tamp, buf, len, flags);
} else {
// at this point, the RTP header has been stripped; This is ASSUMING that there is only 1 CSRC, which in't wise.
switch(st->codec->codec_id) {
rv= 0;
break;
default:
- if(s->parse_packet) {
- rv= s->parse_packet(s, pkt, ×tamp, buf, len);
- } else {
- av_new_packet(pkt, len);
- memcpy(pkt->data, buf, len);
- }
+ av_new_packet(pkt, len);
+ memcpy(pkt->data, buf, len);
break;
}