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

[Feature/RFC] Support external audio tracks with dvdplayer #2562

Closed
wants to merge 512 commits into from

Conversation

ace20022
Copy link
Member

@ace20022 ace20022 commented Apr 7, 2013

This PR adds the possibility to play external audio tracks together with video files.
The original PR is here:#1337. Currently there is no support for language/type extraction from the filename. It can easily be added after #1365 got merged, the code for that is in my repo.

I implemented it with minimal code changes/additions in mind. The idea is to drop/ignore audio packets from internal tracks if an external track is selected. The read rate is hard-coded at the moment, maybe someone has a solution for that flaw. I'm not sure if this leads to performance issues on low power devices.
There are at least 2 shortcomings at the moment:

  • playback stops if the selected external track reaches its end (before the end of the video stream)
  • seeking may lead to temporary stutter

Two other approaches that came to my mind are

BTW this was my first contact with c++ and xbmc-code, so it's certainly far from perfect.

@ghost ghost self-assigned this Apr 8, 2013
@MartijnKaijser
Copy link
Member

@cptspiff
as you requested

@akva2
Copy link
Contributor

akva2 commented Apr 8, 2013

thanks, seen it but i also have this pesky thing called a real life job ;)

@ace20022
Copy link
Member Author

ace20022 commented Apr 9, 2013

@cptspiff

i'm wondering if zipped/rarred extra audio tracks is common enough to warrant the overhead...

Not sure either, just copied it from the external subtitle code. I think I should refactor and reuse that.

some of this code made me deja vu ;)

I will think about a way to remove the duplications :)

Thanks a lot so far! I'm afraid it will take some time to update it; I simply don't have much spare time at the moment ;(

@ace20022
Copy link
Member Author

@cptspiff I've implemented most of your comments. The overall diff of util.c is quite a mess due to the renaming I've done. I wasn't aware of that because I only saw the individual diffs until I've push them to here. I can revert the renaming stuff if you prefer that.

Things not done yet:

  • I've commented to the first one: ace20022@9d3848b#xbmc-cores-dvdplayer-dvdplayer-cpp-P172
  • The code duplication in DVDPlayer and DVDFileInfo.
    • Do you think I can solve this by adding an new class?
  • playback stops if the selected external track reaches its end (before the end of the video stream)
    • maybe fall back to next audio stream?
  • seeking may lead to temporary stutter
    • really no glue :(

Best regards!

@elupus
Copy link
Contributor

elupus commented Apr 14, 2013

This get a bit messy in dvdplayer. The code need to be generalized so external and internal demuxers are handled similar. Making the m_pInputStream and m_pDemuxer arrays them selfes, so we can iterate over them easily and use the same code independent on where it is reading from.

@ace20022
Copy link
Member Author

@elupus finally ;-)

@ace20022
Copy link
Member Author

@cptspiff are the utils changes okay? If so I could clean this pr up a bit.

@akva2
Copy link
Contributor

akva2 commented Apr 25, 2013

no time to review in detail now, but in principle they look exactly what i had in mind.

@ace20022
Copy link
Member Author

@elupus I've uploaded an approach of your suggestion to a separate branch: https://github.com/ace20022/xbmc/commits/ext_audio_unified (https://github.com/ace20022/xbmc/compare/ext_audio_unified)
Of course, only the changes to dvdplayer.c/h are of interest. Could you please have look at it when you find some time?

@ace20022
Copy link
Member Author

ace20022 commented May 7, 2013

@elupus @cptspiff Could you please have a look at the above-mentioned commit. If this is the way to go, I can revise this pr. (I'm a bit bored by all the cppcheck stuff by now ;) )

@jenkins4xbmc
Copy link
Contributor

Is this PR ment to be tested by jenkins?

@ace20022
Copy link
Member Author

@elupus @cptspiff New attempt, are you still interested?
Rebased and implemented elupus' suggestion, at least if I understood it correctly ;)

m_pInputStream->Abort();
for(unsigned int i = 0; i < m_pInputStreams.size(); i++)
{
if(m_pInputStreams[i])

This comment was marked as spam.

@ace20022
Copy link
Member Author

ace20022 commented Jul 4, 2013

@elupus Thanks for the review. I've made some changes, could you please have another look?

@gladeo
Copy link

gladeo commented Jul 30, 2013

Hi,
i would like to play together m2v and wav files (from camcorder) in xbmc

my cam saves like this:
video.m2v
audio_1.wav (left channel)
audio_2.wav (right channel)

i have tons of such material and i don't want to put all that stauff in container or use any conversion

Thank you

@MartijnKaijser
Copy link
Member

@elupus
can you look over this PR?

@ace20022
Copy link
Member Author

ace20022 commented Aug 9, 2013

@elupus I have cleaned up the mess regarding the not squashed commits. Sorry again. Could you please review it again?

@NanNans
Copy link

NanNans commented Aug 16, 2013

Hello! Sorry to drop in like this with a non-technical message, but I just wanted to let you know @ace20022 that I am really excited by the possibilities of your work here, and I really appreciate all the time you've spent on this. Just by jumping around the various forum posts about this project I've gotten a sense of what a long and frustrating journey it has been to get to this point. The support for external audio tracks seems like such an obviously needed feature (I'm sure that the kind of people who use XBMC are the kind of people who like listening to DVD commentaries) that I'm surprised you've had to do so much on your own. I wish I could offer some useful help, but my coding skills are nowhere near strong enough. The best I can do is cheer you on from the sidelines and let you know that your work is not in vain. I can hardly wait for the chance to try out what you've been doing... my commentary tracks have been silent for too long! Thank you!

@ace20022
Copy link
Member Author

ace20022 commented Sep 7, 2013

@elupus ping.

Memphiz and others added 16 commits March 25, 2014 17:40
[depends] - add missing dependency for python native (needs libz-native)
[darwinsink] - increase the initial startup timeout of the sinks to 1900...
[pvr] fixes related to chanel icons
[shairplay] - upstream backports - fix password protection and socket race condition
Add void CUtil::GetPathsToLookForAssociatedItems()
Add void CUtil::ScanPathsForAssociatedItems(...)
Add int CUtil::ScanArchiveForAssociatedItems()
ScanForExternalSubtitles(...) now uses GetPathsToLookForAssociatedItems() and ScanPathsForAssociatedItems(...).
Remove obsolete method ScanArchiveForSubtitles() and sub_exts[].
… them.

Update the SelectionStream.
Adapt all relevant places where m_pDemuxer is used; in particular ReadPacket(...) and add ReadExternalAudioPacket(...)
… them.

Update the SelectionStream.
Adapt all relevant places where m_pDemuxer is used; in particular ReadPacket(...) and add ReadExternalAudioPacket(...)
…rnal audio files (e.g. language and channels).
@ace20022 ace20022 reopened this Mar 28, 2014
@ace20022 ace20022 removed this from the Helix 14.0-alpha1 milestone Apr 28, 2014
@MartijnKaijser MartijnKaijser added this to the Pending for inclusion milestone May 21, 2014
@ace20022 ace20022 removed the Helix label Sep 1, 2014
@ace20022 ace20022 closed this Jan 15, 2015
@MartijnKaijser MartijnKaijser modified the milestones: Pending for inclusion, Abandoned, obsolete or superseeded Mar 21, 2015
@ace20022 ace20022 deleted the external_audio branch May 22, 2015 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet