Ticket #2054 (closed bug: fixed)

Opened 16 years ago

Last modified 15 years ago

[native][win]Trying to open a book with video file causes media_decoder.exr to crash

Reported by: deyan Owned by: stefan
Priority: major Milestone: M12_RELEASE
Component: uncategorized Version: 2.0
Keywords: Cc: stefan
Category: unknown Effort:
Importance: Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: deyan Design_owners: nenko, stefan
Imp._owners: stefan Test_owners:
Analysis_reviewers: Changelog:
Design_reviewers: pap, meddle Imp._reviewers: pap, meddle
Test_reviewers: Analysis_score: 0
Design_score: 3 Imp._score: 3
Test_score: 0

Description

Trying to open a book with video file causes media_decoder.exe to stop responding. The book is attached and the Windows error message

Problem signature:

Problem Event Name: APPCRASH
Application Name: media_decoder.exe
Application Version: 0.0.0.0
Application Timestamp: 4aba541c
Fault Module Name: media_decoder.exe
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4aba541c
Exception Code: 40000015
Exception Offset: 0045e57a
OS Version: 6.0.6002.2.2.0.256.1
Locale ID: 1026
Additional Information 1: efdf
Additional Information 2: a0db112c0608b3427f34ef0c41cf3a95
Additional Information 3: 305d
Additional Information 4: 93186894d4d2897336808366703a53ac

Read our privacy statement:

http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409


Attachments

av2i.sjrb (1.5 KB) - added by deyan 16 years ago.

Change History

Changed 16 years ago by deyan

comment:1 Changed 16 years ago by deyan

  • Status changed from new to s1b_analysis_finished

comment:2 Changed 16 years ago by nenko

  • Design_owners set to nenko
  • Status changed from s1b_analysis_finished to s2a_design_started

comment:3 Changed 16 years ago by stefan

  • Design_owners changed from nenko to nenko, stefan
  • Status changed from s2a_design_started to s2b_design_finished

Working branch for the fix is http://sophie2.org/trac/browser/branches/private/stefan/bug2054NewTrunk
In order to fix this bug, the KEY_DATA field of the MediaResourceR4 class (org.sophie2.main.func.media.model.resources module) is defined as follows (in order to enable saving and loading of media content in the specific book that is loading or saving:

/**
 * The {@link BinData} of the media.
 */
public static final SimpleKey<BinData> KEY_DATA = new SimpleKey<BinData>(
		"data", BinData.class, BinData.EMPTY_DATA) {
	@Override
	public void persistR3(ValueRef<BinData> ref, Storage destination,
			PersistenceOptions options, String format) throws IOException {
		final Storage storage = destination.child("media");
		if (options.isSaveMode() && ref.get() == null) {
			return;
		}
		if (options.isLoadMode() && storage.getAttribute("src") == null) {
			ref.set(null);
			return;
		}
		if (options.isLoadMode()) {
			ref.set(new BinData(storage.getParent().getParent().getParent()
				.attribute("_data").attribute("media.dat")
				.getByteContent().getBytes()));
		} else if (options.isSaveMode()) {
			storage.getParent().getParent().getParent().attribute("_data").attribute("media.dat").setByteContent(ref.get());
			storage.attribute("src").setTextContent("./_data/media.dat");
				
		}
	}
};

Related code, regarding the fix: [7074]

comment:4 Changed 16 years ago by stefan

Related code, regarding the fix:

comment:5 Changed 16 years ago by stefan

Should be noted that the attached file (the book - av2i.sjrb) cannot be used as reference for testing whether the bug is fixed or not, because in the time that the book was created, the saving of the books which contained media was faulty (saving of the book did not really saved any kind of media).

comment:6 Changed 16 years ago by stefan

  • Status changed from s2b_design_finished to s2c_design_ok

comment:7 Changed 16 years ago by stefan

  • Owner set to stefan
  • Status changed from s2c_design_ok to s3a_implementation_started

comment:8 Changed 16 years ago by stefan

  • Status changed from s3a_implementation_started to s3b_implementation_finished
  • Imp._owners set to stefan

comment:9 Changed 16 years ago by pap

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Cc stefan added
  • Imp._reviewers set to pap, meddle
  • Design_score changed from 0 to 3
  • Design_reviewers set to pap, meddle
  • Imp._score changed from 0 to 3
  • It is nice that we have audio and video in books now but you could've made a better solution.
  • Instead of writing/reading the contents of the BinData yourself you should use MasterPersister.persist
  • Commited in [7147].
  • Have a look at the implementation.

comment:10 Changed 15 years ago by deyan

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to fixed

fixed

Note: See TracTickets for help on using tickets.