Skip to content

Commit 3679f82

Browse files
author
印体亮
committed
replace memcpy with memmove
1 parent cf109a3 commit 3679f82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/tsinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main(int argc, char **charv) {
7373
// this may happen if we read partial packets from file, or there was
7474
// some corruption in the TS stream.
7575
if(parsed < count) {
76-
memcpy(buffer, buffer, count - parsed);
76+
memmove(buffer, buffer, count - parsed);
7777
}
7878
} while(count > 0);
7979

@@ -99,7 +99,7 @@ void event_cb(TSDemuxContext *ctx, uint16_t pid, TSDEventId event_id, void *data
9999
TSDPESPacket *pes = (TSDPESPacket*) data;
100100
// This is where we would write the PES data into our buffer.
101101
printf("\n====================\n");
102-
printf("PID %d PES Packet, Size: %d\n", pid, pes->data_bytes_length);
102+
printf("PID %d PES Packet, Size: %d, stream_id=%u, pts=%llu, dts=%llu\n", pid, pes->data_bytes_length, pes->stream_id, pes->pts, pes->dts);
103103
}else if(event_id == TSD_EVENT_ADAP_FIELD_PRV_DATA) {
104104
// we're only watching for SCTE Adaptions Field Private Data,
105105
// so we know that we must parse it as a list of descritors.

0 commit comments

Comments
 (0)