Opened 18 years ago
Closed 17 years ago
#4925 closed defect (invalid)
Title: internal dvd player: mytharchive mp2 audio playback issues
| Reported by: | skamithi | Owned by: | skamithi |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | mythtv | Version: | 0.21-fixes |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
This issue was identified by John Pilkington and posted in #2797.
if I issue ffmpeg -i on a mytharchive dvd I created about 1 year ago i get
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 9000 kb/s, 25.00 fps(r)
Stream #0.1[0x80]: Audio: liba52, 48000 Hz, stereo, 448 kb/sStream #0.2[0x1c0]: Audio: mp2
The 2nd audio stream has no sample rate info. I wonder if this is a ffmpeg bug ?
attached patch does 2 things:
a) change the location AFD::RemoveAudioStreams is activated. This function cleans up the stream contexts so stale audio stream entries are removed from the list. new location is in AFD::ScanStreams and is activated only when the DVD encounters the AUDIO_STREAM_CHANGE event.
b)set the sample rate default to 48000hz if sample_rate is 0 but channels are detected. this change is only activated for DVD playback. This 2nd change can be removed if the sample rate issue is a bug and is cleared up at some point.
attached patch resolves the issue. testing it for a couple of weeks to ensure it doesn't break dvd playback for me.
Attachments (3)
Change History (16)
by , 18 years ago
| Attachment: | mythtv_remove_audio_stream.diff added |
|---|
comment:1 by , 18 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 18 years ago
by , 18 years ago
| Attachment: | remove_audio_streams_v2.diff added |
|---|
comment:3 by , 18 years ago
comment:4 by , 18 years ago
(In [16660]) Refs #4925: internal dvd player: activate cleanup of the list of audio streams in the ffmpeg avformatcontext when a dvd AUDIO_CHANGE event occurs. remove previous logic where this was only activated at a title change. will apply to fixes in a couple of weeks if no one reports problems with it.
comment:5 by , 18 years ago
Erik Hovland made another minor patch to the second patch here in ticket #5002, which I think needs to be included.
comment:6 by , 18 years ago
comment:7 by , 18 years ago
comment:8 by , 18 years ago
comment:9 by , 18 years ago
comment:10 by , 18 years ago
call to av_read_frame_flush in AFD:RemoveAudioStreams is causing dvd still frames not to show up on some dvds. if i remove this call, dvds with a lot of audio changes in the dvd menu crash like crazy on various ffmpeg functions because the codec is still defined by the memory associated with it is deleted. patch attached to the ticket. if anyone has a better way of solving this, please let me know.
by , 18 years ago
| Attachment: | attempt_resolve_crashes_after_removing_streams.diff added |
|---|
comment:11 by , 18 years ago
(In [17304]) Refs #4925 Refs #4862. internal dvd player: remove av_read_frame_flush call when purging audio streams during an audio stream change. commit out some code in utils.c av_remove_stream to help prevent crashes during this process. i hope it doesn't cause issues for anyone else. also noticed latest ffmpeg doesn't have av_remove_stream defined.so whenever a ffmpeg sync is done, i'll have to find a new solution here if the latest ffmpeg doesn't automatically clean out previously used audio streams.
comment:13 by , 17 years ago
| Resolution: | → invalid |
|---|---|
| Status: | infoneeded → closed |
No feedback from ticket submitter in 30 days

2nd rev of this patch. found out that by reinitializing the audioIn variable in avformatdecoder to the default when audio is disabled, resolves the issue where audio is not enabled when the audio streams change. no need for the hack in the v1 patch where i set the default sample rate to 48000 if a channel is present.
patch adds checks to ffmpeg's utils.c to help avoid a crash during while AFD::RemoveAudioStreams is active.