History

avformat/rtmpproto: Fix 2 more cases of the 2nd packet size being wrong

This should fix RTMP input which was broken by cbbd906be6150be38dfc14b6bc67dcac8da8aea4 the 40 + 11 case is untested as it did not occur in the testcase

Michael Niedermayer committed 11 years ago

Commit 94d50b51 parent ac7b1f71 file · +3 −2Browse files

Unified · Split

libavformat/rtmpproto.c+3−2
@@ -2368,8 +2368,9 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt) · 2367 unmodified lines
2368 bytestream_put_be24(&p, ts);2368 bytestream_put_be24(&p, ts);
2369 bytestream_put_byte(&p, ts >> 24);2369 bytestream_put_byte(&p, ts >> 24);
2370 memcpy(p, next, size + 3 + 4);2370 memcpy(p, next, size + 3 + 4);
2371 p += size + 3;
2372 bytestream_put_be32(&p, size + 11);
2371 next += size + 3 + 4;2373 next += size + 3 + 4;
2372 p += size + 3 + 4;
2373 }2374 }
2374 if (p != rt->flv_data + rt->flv_size) {2375 if (p != rt->flv_data + rt->flv_size) {
2375 av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "2376 av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "
@@ -2559,7 +2560,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt) · 183 unmodified lines
2559 // Finalise object2560 // Finalise object
2560 bytestream_put_be16(&p, 0); // Empty string2561 bytestream_put_be16(&p, 0); // Empty string
2561 bytestream_put_byte(&p, AMF_END_OF_OBJECT);2562 bytestream_put_byte(&p, AMF_END_OF_OBJECT);
2562 bytestream_put_be32(&p, 40); // size of data part (sum of all parts below)2563 bytestream_put_be32(&p, 40 + 11); // size of data part (sum of all parts below)
2563 2564
2564 return 0;2565 return 0;
2565}2566}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t