Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in ffmpeg when switching audio track in a network stream #5251

Closed
xyzz opened this issue Dec 18, 2017 · 8 comments
Closed

Crash in ffmpeg when switching audio track in a network stream #5251

xyzz opened this issue Dec 18, 2017 · 8 comments

Comments

@xyzz
Copy link
Contributor

xyzz commented Dec 18, 2017

mpv version and platform

mpv: d690ee0
ffmpeg: 3f887440677328c9cfed97ad81d14051ffa32aae

(compiled with mpv-build)

Reproduction steps

  1. Start a twitch stream, e.g. mpv https://www.twitch.tv/aimbotcalvin
  2. Rapidly click on the audio track icon in the OSD (sometimes it takes 2 clicks, sometimes up to 10)

Expected behavior

mpv does not crash

Actual behavior

mpv crashes :(

Log file

Output from gdb:

[...]
(Buffering) AV: 00:00:08 / unknown A-V:  0.000 Cache:  0s+6KB
Track switched:
 (+) Video --vid=1 (h264 1280x720)
     Audio --aid=1 (aac 2ch 44100Hz)
(Buffering) V: 00:00:08 / unknown Cache:  0s+6KB
Track switched:
 (+) Video --vid=1 (h264 1280x720)
 (+) Audio --aid=1 (aac 2ch 44100Hz)
(Buffering) AV: 00:00:08 / unknown A-V:  0.000 Cache:  0s+6KB
Thread 8 "mpv/demux" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe4ee4700 (LWP 31463)]
ffurl_get_short_seek (h=0x0) at src/libavformat/avio.c:650
650	    if (!h->prot->url_get_short_seek)
(gdb) bt
#0  ffurl_get_short_seek (h=0x0) at src/libavformat/avio.c:650
#1  0x00005555559e4f98 in avio_seek (s=0x7fffd0397660, offset=8846, whence=<optimized out>, whence@entry=0) at src/libavformat/aviobuf.c:275
#2  0x0000555555afe26d in seek_frame_generic (flags=1, timestamp=850835880, stream_index=1, s=0x7fffd063b4c0) at src/libavformat/utils.c:2365
#3  seek_frame_internal (flags=1, timestamp=850835880, stream_index=1, s=0x7fffd063b4c0) at src/libavformat/utils.c:2444
#4  av_seek_frame (s=0x7fffd063b4c0, stream_index=stream_index@entry=-1, timestamp=timestamp@entry=9453732000, flags=flags@entry=1) at src/libavformat/utils.c:2464
#5  0x000055555570c7ec in demux_seek_lavf (demuxer=0x7fffd030faa0, seek_pts=<optimized out>, flags=<optimized out>) at ../demux/demux_lavf.c:1027
#6  0x00005555557042e7 in execute_seek (in=0x7fffd010edd0) at ../demux/demux.c:1400
#7  0x0000555555706425 in thread_work (in=0x7fffd010edd0) at ../demux/demux.c:1421
#8  0x0000555555706854 in demux_thread (pctx=0x7fffd010edd0) at ../demux/demux.c:1444
#9  0x00007fffef0b408a in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007fffef3c142f in clone () from /usr/lib/libc.so.6

Sample files

I haven't been able to reproduce this with a local file.


Not sure if this is an mpv or ffmpeg issue, not sure how to reproduce with just ffmpeg.

@CounterPillow
Copy link
Contributor

Can reproduce with

$ mpv --version
mpv 0.27.0-548-g3c4667c862 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Sun Dec 17 06:45:33 CET 2017
ffmpeg library versions:
   libavutil       56.6.100
   libavcodec      58.8.100
   libavformat     58.3.100
   libswscale      5.0.101
   libavfilter     7.7.100
   libswresample   3.0.101
ffmpeg version: N-89514-g0ee143558d

it first stalls buffering for a while, then a few seconds later appears to crash altogether.

@xyzz
Copy link
Contributor Author

xyzz commented Dec 18, 2017

Same issue when seeking a live stream. Also when googling for that function name, I found this https://trac.ffmpeg.org/ticket/6846 which might be relevant.

@Jj0YzL5nvJ
Copy link

Same here:

mpv 0.27.0-530-g6c8e7daebb (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Mon Dec 11 18:56:04 MST 2017
ffmpeg library versions:
   libavutil       56.5.100
   libavcodec      58.6.103
   libavformat     58.3.100
   libswscale      5.0.101
   libavfilter     7.7.100
   libswresample   3.0.101
ffmpeg version: N-89466-g555119bd76

Log file
https://0x0.st/sX0B.txt

@ghost
Copy link

ghost commented Dec 19, 2017

Almost certainly ffmpeg bugs. fffmpeg's HLS demuxer isn't very good.

@Jj0YzL5nvJ
Copy link

Adding --no-video you can obtain such mention in the log... https://0x0.st/sX0S.txt

@ghost
Copy link

ghost commented Dec 20, 2017

Seems like this is the ffmpeg issue, which seems to confirm that it's a ffmpeg bug: https://trac.ffmpeg.org/ticket/6846

@Jj0YzL5nvJ
Copy link

I can't reproduce anymore:

mpv 0.28.0-72-ge894f75bb5 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Wed Jan  3 19:04:39 MST 2018
ffmpeg library versions:
   libavutil       56.7.100
   libavcodec      58.9.100
   libavformat     58.3.100
   libswscale      5.0.101
   libavfilter     7.9.100
   libswresample   3.0.101
ffmpeg version: N-89682-g88cbd25b19

@kevmitch
Copy link
Member

kevmitch commented Jan 4, 2018

should be fixed by FFmpeg/FFmpeg@be4dfbf

@kevmitch kevmitch closed this as completed Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants