Reverting back a few style changes for better review.

This commit is contained in:
sr90 2020-06-12 16:12:55 -07:00
parent f522c01ed8
commit d5d376cb0a
3 changed files with 11 additions and 10 deletions

View File

@ -9,7 +9,6 @@
#include <atomic>
#include <memory>
#include "packager/base/synchronization/waitable_event.h"
#include "packager/file/file.h"
#include "packager/file/file_closer.h"

View File

@ -27,7 +27,7 @@
// IP_MULTICAST_ALL has been supported since kernel version 2.6.31 but we may be
// building on a machine that is older than that.
#ifndef IP_MULTICAST_ALL
#define IP_MULTICAST_ALL 49
#define IP_MULTICAST_ALL 49
#endif
#endif // defined(OS_WIN)
@ -205,20 +205,24 @@ bool UdpFile::Open() {
struct ip_mreq_source source_multicast_group;
source_multicast_group.imr_multiaddr = local_in_addr;
if (inet_pton(AF_INET, options->interface_address().c_str(),
if (inet_pton(AF_INET,
options->interface_address().c_str(),
&source_multicast_group.imr_interface) != 1) {
LOG(ERROR) << "Malformed IPv4 interface address "
<< options->interface_address();
return false;
}
if (inet_pton(AF_INET, options->source_address().c_str(),
if (inet_pton(AF_INET,
options->source_address().c_str(),
&source_multicast_group.imr_sourceaddr) != 1) {
LOG(ERROR) << "Malformed IPv4 source specific multicast address "
<< options->source_address();
return false;
}
if (setsockopt(new_socket.get(), IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP,
if (setsockopt(new_socket.get(),
IPPROTO_IP,
IP_ADD_SOURCE_MEMBERSHIP,
reinterpret_cast<const char*>(&source_multicast_group),
sizeof(source_multicast_group)) < 0) {
LOG(ERROR) << "Failed to join multicast group, error = "
@ -245,7 +249,7 @@ bool UdpFile::Open() {
<< GetSocketErrorCode();
return false;
}
}
}
#if defined(__linux__)
// Disable IP_MULTICAST_ALL to avoid interference caused when two sockets

View File

@ -50,7 +50,7 @@ const uint8_t kNaluLengthSize = 1;
const bool kIsEncrypted = false;
const uint8_t kAnyData[] = {
0x01, 0x0F, 0x3C,
0x01, 0x0F, 0x3C,
};
class MockPesPacketGenerator : public PesPacketGenerator {
@ -349,9 +349,7 @@ TEST_F(TsSegmenterTest, EncryptedSample) {
ON_CALL(*mock_pes_packet_generator_, Flush()).WillByDefault(Return(true));
const uint8_t kAnyData[] = {
0x01,
0x0F,
0x3C,
0x01, 0x0F, 0x3C,
};
std::shared_ptr<MediaSample> sample1 =
MediaSample::CopyFrom(kAnyData, arraysize(kAnyData), kIsKeyFrame);