Skip to content

Commit 29db7f4

Browse files
committed
调整audiosession & realtime
1 parent 123c04d commit 29db7f4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ijkmedia/ijkplayer/ff_ffplay.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,11 @@ static int stream_has_enough_packets(AVStream *st, int stream_id, PacketQueue *q
30763076

30773077
static int is_realtime(AVFormatContext *s, int packet_buffering)
30783078
{
3079-
return 1;// for test
3079+
printf("isreal====>%s", s->iformat->name);
3080+
if (!strcmp(s->iformat->name, "androidio")) {
3081+
return 1;
3082+
}
3083+
30803084
if( !strcmp(s->iformat->name, "rtp")
30813085
|| !strcmp(s->iformat->name, "rtsp")
30823086
|| !strcmp(s->iformat->name, "sdp")

ios/IJKMediaPlayer/IJKMediaPlayer/IJKAudioKit.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ - (void)setupAudioSession
5151

5252
/* Set audio session to mediaplayback */
5353
NSError *error = nil;
54-
if (NO == [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error]) {
54+
if (NO == [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&error]) {
5555
NSLog(@"IJKAudioKit: AVAudioSession.setCategory() failed: %@\n", error ? [error localizedDescription] : @"nil");
5656
return;
5757
}

0 commit comments

Comments
 (0)