Opened 14 years ago

Closed 13 years ago

#8134 closed defect (Unverified)

internal dvd player: pcm_s16be improperly detected as pcm_dvd audio codec.

Reported by: skamithi Owned by: Janne Grunau
Priority: minor Milestone: unknown
Component: MythTV - DVD Playback Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by skamithi)

dvds with audio using a mix of the PCM_DVD and PCM_S16BE codecs play really fast because AvFormatDecoder? is using the wrong sample_fmt.

Skipping back or forwards makes no difference. If you play a single VOB file, it plays just fine.

Not sure when this problem started, but the bug is in trunk. may be related to the latest ffmpeg sync

Working on a fix.

Attachments (5)

ticket_8134_fix.patch (1.5 KB) - added by skamithi 14 years ago.
afd_based_solution_to_8134.diff (1.6 KB) - added by skamithi 14 years ago.
ffmpeg alias suggested not changing the audio codec on the fly. this approach uses AvformatDecoder? calls to avoid generating an audio codec for the stream when channels == 0, and if an audio stream with no codec is found, call scanstreams to generate the correct stream. made it dvd specific and pcm_dvd/pcm_s16be specific so it doesn't affect detection of other audio codecs.
afd_based_solution_to_8134_v2.diff (1.6 KB) - added by skamithi 14 years ago.
make scanstream check a little more broad, so expand to catch any audio codec with 1 channel or more.
afd_based_solution_to_8134_v3.diff (1.7 KB) - added by skamithi 14 years ago.
add qmutexlocker around call to scanstreams to prevent ffmpeg related crashes.
ffmpeg_based_fix_for_8134.diff (1.1 KB) - added by skamithi 14 years ago.
ffmpeg based fix. change the way streams changed is called. this ensure that dvd audio streams are properly detected.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 14 years ago by skamithi

Owner: changed from Isaac Richards to skamithi
Status: newassigned

comment:2 Changed 14 years ago by skamithi

Description: modified (diff)

Changed 14 years ago by skamithi

Attachment: ticket_8134_fix.patch added

comment:3 Changed 14 years ago by skamithi

ffmpeg first detects PCM_DVD audio codec in some dvd streams, and soon after in the same stream detects PCM_S16BE codec. this patch generates the correct avcodec when this happens to prevent either fast dvd playback or no sound. #21891 therefore becomes unnecessary. patch also revert #21891

comment:4 in reply to:  3 Changed 14 years ago by skamithi

Replying to skamithi:

ffmpeg first detects PCM_DVD audio codec in some dvd streams, and soon after in the same stream detects PCM_S16BE codec. this patch generates the correct avcodec when this happens to prevent either fast dvd playback or no sound. #21891 therefore becomes unnecessary. patch also revert #21891

sorry i meant [21891] not #21891

comment:5 Changed 14 years ago by skamithi

submitted patch to ffmpeg group. Waiting for feedback before applying whatever amended patch the ffmpeg folks suggest.

Changed 14 years ago by skamithi

ffmpeg alias suggested not changing the audio codec on the fly. this approach uses AvformatDecoder? calls to avoid generating an audio codec for the stream when channels == 0, and if an audio stream with no codec is found, call scanstreams to generate the correct stream. made it dvd specific and pcm_dvd/pcm_s16be specific so it doesn't affect detection of other audio codecs.

Changed 14 years ago by skamithi

make scanstream check a little more broad, so expand to catch any audio codec with 1 channel or more.

Changed 14 years ago by skamithi

add qmutexlocker around call to scanstreams to prevent ffmpeg related crashes.

comment:6 Changed 14 years ago by robertm

Component: MythTV - GeneralMythTV - DVD Playback

Changed 14 years ago by skamithi

ffmpeg based fix. change the way streams changed is called. this ensure that dvd audio streams are properly detected.

comment:7 Changed 14 years ago by skamithi

Summary: internal dvd player: fast dvd playback (not related to #7067)internal dvd player: pcm_s16be improperly detected as pcm_dvd audio codec.

comment:8 Changed 14 years ago by skamithi

(In [24239]) Refs #8134. internal dvd player. resolve problem where pcm_s16be audio codec is detected as pcm_dvd codec instead. also revert [21891]. workaround can be undone after this change.

comment:9 Changed 14 years ago by skamithi

janneg: go to http://38.114.169.249/JM_VIDEO.tar.bz2 to get the stripped iso that shows the problem. audio transitions from AC3 to PCM_S16BE in the dvd menu intros.

If you find a better way to fix this, that would be awesome. thx.

comment:10 Changed 14 years ago by skamithi

(In [24306]) Refs #8134. revert most of [24239]. Anduin withers reported it makes ivtv generated mpeg files unplayable. janneg is assisting in finding a better solution anyways.

comment:11 Changed 14 years ago by robertm

Owner: changed from skamithi to Janne Grunau

Stanley taking a break, reassigning to Janne for lack of anyone better to look at it.

comment:12 Changed 13 years ago by robertm

Status: assignedinfoneeded

Stanley, are you available to check whether this is now fixed? Your sample is no longer available and Mark's recent changes to the DVD audio stream change code may have fixed this.

comment:13 Changed 13 years ago by robertm

Milestone: 0.24unknown

comment:14 Changed 13 years ago by stuartm

Resolution: Unverified
Status: infoneededclosed
Note: See TracTickets for help on using tickets.